Hi Neerja,

I had to do something similar and got around the issue like this.

Create a HTTP Header Manager
Specify
Content-Type multipart/form-data; boundary=zyxw11111111111111abcd

In the HTTP Request Sampler in the Body Data specify

--zyxw11111111111111abcd
Content-Disposition: form-data; name="metadata"

{"description":"test math document","title":"Test Doc 
${cn_filename}","standards":{},"source":{"provider":"IBM","publisher":"IBM"},"authors":["carmine"],"academic":{"grades":["5","6","7"]}}
--zyxw11111111111111abcd
Content-Disposition: form-data; name="file"; filename="${cn_filename}"
Content-Type:text/html

"${__FileToString(/Users/[email protected]<mailto:Users/[email protected]>/github/cn-jmeter-tests/API_Load_Tests/${cn_filename})}"
--zyxw11111111111111abcd--


You will need to change the parameters of course.  I don’t think you will need 
the first section but you may.  I’m not sure what the specifications are for 
your API.

Regards,

Lisa JM Waugh
Performance Test Engineer
Pricing@IBM
Phone: 1-720-342-5373 | Mobile: 1-704-907-7008
E-mail: [email protected]<mailto:[email protected]>

3039 E Cornwallis Rd
Research Triangle Park, NC 27709-2195
United States

On Jun 6, 2020, at 7:58 AM, 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>> 
wrote:

Hi Team,

I am facing issue in file upload in "Use multipart/formdata for POST' scenario 
in Jmeter.

I have some parameters and a file to upload through application request. My 
request is passed in below format:
POST data:
--U-vs1MTIQWNtOTukw4J366lA0xKWNxa
Content-Disposition: form-data; name="Employeto.employeeSurname"
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
....
....
....
....


I have tried both steps :

1.Ticked Use multipart/form-data for POST box in the HTTP Request sampler.
2.Removed tag of Content-Type header in the HTTP Header Manager.

Still I am getting error in Response :{"Error Occurred While Saving 
File.","result":null}
. . .
What could be the resolution. Could anyone help.


Regards,
Neeraj Kumar
+91-9158915417



Sensitivity: Internal & Restricted

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com<http://www.wipro.com>

Reply via email to