DLapus
11 years agoOccasional Contributor
Issue With File Upload
SmartBear Support,
I posted this while ago, was expecting some Pro support, still dint get any response, so I am reposting this as separate thread,
please check this.
I have to do a POST request for file upload. here is details of my call.
1. Attached the file in the tab, set it as multipart/form-data
2. Need to give some parameter values , which has information where the file will be upload.
I have put in tab below "media Type" - checked "Post Querystring"
sample data:
data
{ "FileBlade": "EBF9EE5649DB449E86F500C869BC2698",
"FileFolder": "C4FFF652663942828E50E7B2E4499915",
"ContentLength": 50000,
"ContentType": "txt"
}
when i POST the request i am getting 500 error. when i tried using "REST Console "chrome addon, this is working fine.
This is my test request:
---- start
POST http://ip/shared/customfiles HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_2_28697245.1370978871834"
Authorization: Bearer {b5814f3f-4562-4082-9a36-52a1705b5c4e}
MIME-Version: 1.0
Content-Length: 558
Host: ip
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
-----=_Part_2_28697245.1370978871834
Content-Type: multipart/form-data
Content-Transfer-Encoding: 8bit
data
{ "FileBlade": "EBF9EE5649DB449E86F500C869BC2698",
"FileFolder": "C4FFF652663942828E50E7B2E4499915",
"ContentLength": 50000,
"ContentType": "txt"
}
------=_Part_2_28697245.1370978871834
Content-Type: multiform/form-data; name=Prtest.txt
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="Prtest.txt"; filename="Prtest.txt"
hi world
------=_Part_2_28697245.1370978871834--
SmartBear Support, can you please check and let me know what is wrong here.
Thanks for the help.
I posted this while ago, was expecting some Pro support, still dint get any response, so I am reposting this as separate thread,
please check this.
I have to do a POST request for file upload. here is details of my call.
1. Attached the file in the tab, set it as multipart/form-data
2. Need to give some parameter values , which has information where the file will be upload.
I have put in tab below "media Type" - checked "Post Querystring"
sample data:
data
{ "FileBlade": "EBF9EE5649DB449E86F500C869BC2698",
"FileFolder": "C4FFF652663942828E50E7B2E4499915",
"ContentLength": 50000,
"ContentType": "txt"
}
when i POST the request i am getting 500 error. when i tried using "REST Console "chrome addon, this is working fine.
This is my test request:
---- start
POST http://ip/shared/customfiles HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_2_28697245.1370978871834"
Authorization: Bearer {b5814f3f-4562-4082-9a36-52a1705b5c4e}
MIME-Version: 1.0
Content-Length: 558
Host: ip
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
-----=_Part_2_28697245.1370978871834
Content-Type: multipart/form-data
Content-Transfer-Encoding: 8bit
data
{ "FileBlade": "EBF9EE5649DB449E86F500C869BC2698",
"FileFolder": "C4FFF652663942828E50E7B2E4499915",
"ContentLength": 50000,
"ContentType": "txt"
}
------=_Part_2_28697245.1370978871834
Content-Type: multiform/form-data; name=Prtest.txt
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="Prtest.txt"; filename="Prtest.txt"
hi world
------=_Part_2_28697245.1370978871834--
SmartBear Support, can you please check and let me know what is wrong here.
Thanks for the help.