cancel
Showing results for 
Search instead for 
Did you mean: 

Upload of zip file via PUT to Azure results in file with 0 bytes written

Highlighted
Occasional Contributor

Upload of zip file via PUT to Azure results in file with 0 bytes written

Hi,

I need to translate the following request into Soap UI NG: it is basically a PUT to an Azure URL where I need to upload a zip file.

 

curl -X PUT -H "x-ms-blob-type:BlockBlob" --upload-file test_file.zip "http://thisismyurl.com"

 

I have created a step, where I attach a zip file. However, the raw pane indicates that the length of the content is 0.

Here is how it looks like:

PUT https://myhost.com/blob_80205bcf-d17a-4342-8dcc-f9cbbd64eb5a.zip HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/octet-stream
x-ms-blob-type: BlockBlob
Content-Length: 0
Host: myhost.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.1 (Java/1.8.0_74)

 

2016-06-14 17_07_37-Ready! API 1.7.0 - SoapUI NG.png

 

What am I doing wrong please?

 

10 REPLIES 10
Highlighted
Community Hero

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

Are you using it in a test case?
Project -> Test Suite -> TestCase -> Test Step.

If you are using it from service interface -> Request , then probably you will not be able to use it.

See documentation
http://readyapi.smartbear.com/projects/ws/attachments/working


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

Yes, I am using a test step inside a test case and valid project.

In short, my problem is that files I upload end up having size 0 (zero) bytes. Postman on the other hand uploads the same file successfully.

 

Somehow I am missing what combination of params and settings results in a succesful package.

 

Highlighted
Community Hero

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

If you click the below 'Part', it should have a drop down and there is associated cid:xxxx some number then it shall work. In your case, it is empty from the screen shot.


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

Hi,

 

The field is empty because I see and there are NO options to choose from the drop down list.

As such in this screen capture.

 

What am I missing please? Thank you!

 

2016-06-15 17_14_49-Ready! API 1.7.0 - SoapUI NG.png

Highlighted
Community Hero

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

May be you can show the request where it allows to have attachment?


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

This?

 

2016-06-15 17_21_04-Ready! API 1.7.0 - SoapUI NG.png

Highlighted
Community Hero

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

Can try changing Media Type (just above request editor) to "multipart/form-data" and try.
For more details see
https://community.smartbear.com/t5/SoapUI-NG/how-to-post-with-attachment-in-REST/td-p/17207


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

Hi,

 

Already tried that, with the effect that content-type is not set as application/octet-stream and the file size is wrong. Ofcourse, the uploaded file is uploaded.

 

Like so:

 

2016-06-16 10_34_11-Select Command Prompt.png

Highlighted
Community Hero

Re: Upload of zip file via PUT to Azure results in file with 0 bytes written

May the file content cached?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements