Reputation: 45
If I upload an image on Postman using only binary option it works. If I use form-data to upload a file on Postman the image file gets corrupted with unnecessary appended info. So I tried to record JMeter script while uploading image on Postman using binary option. But the image size grew from 279kb to 509kb and I got a corrupt image. It's only 279kb when I send on Postman without recording. See pictures below.
If I use the "Files Upload" tab on JMeter HTTP Request, it appends info as below making the image file corrupt. The JAVA implementation on Advanced tab doesn't work either. --WNAkrdOzMmE0iZxPNbdHVVPxuBwgUX Content-Disposition: form-data; name="source"; filename="fileupload.jpg" Content-Type: image/jpeg
Can someone please provide me Groovy or BeanShell code to upload multiple image files one by one? Or, if there is a way to capture the traffic properly without the image file getting corrupt with additional data, please let me know and I can try. Thanks.
Upvotes: 0
Views: 304
Reputation: 168147
binary
file upload means that the file is being send as the HTTP Post request body
JMeter's equivalent configuration would be:
More information: JMeter Performance Testing: Upload and Download Scenarios
Upvotes: 2