cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Rest post zip file issue

kkishore
New Contributor III

Hi Team,

we are posting a zip file to the target location with restpost snap(invoking the webservice provided by target team), but below information is adding to the file and the zip file not able to open by the team.

Target team receiving the data like below adding extra content at header level:

-NpPpHQYDtTHWk9esbHreg29WnKx_bCYn
Content-Disposition: form-data; name=โ€œfileโ€; filename=โ€œdata.zipโ€
Content-Type: application/octet-stream; charset=UTF-8
Content-Transfer-Encoding: binary

actual data(zip format)

-NpPpHQYDtTHWk9esbHreg29WnKx_bCYn

how to avoid this extra content added to original zip file.

Please find the error here while target team trying to open the zip file stored in Blob field of Database.

image

5 REPLIES 5

@kkishore

Try this:

rest-post-binary-zip.1

The important points are that weโ€™ve changed the Upload Body Type from Multipart form-data to Binary. That will prevent emitting the headers that you were seeing in the request body.

However, thatโ€™s not enough, we also need to explicitly set the Content-Type via a HTTP header, otherwise, the content type will default to application/octet-stream. I think content type should be application/zip.

Give this a shot and let me know.