Archived Forum Post

Index of archived forum posts


C# Multipart post Boundry issue

Oct 23 '13 at 09:01

i have to upload a file using multipart post. I am having trouble with boundary. It generate boundary itself, but site ask for custom boundary

What site wants

-----------------------------309821703319246 Content-Disposition: form-data; name="img"; filename="Jellyfish.jpg" Content-Type: image/jpeg

And here is what chilkat is generating

--------------050307070900020401040803 Content-Disposition: form-data; name="img"; filename="Desert.jpg" Content-Type: image/jpeg

Chilkat is not accepting custom boundary

Code i am using

req.AddFileForUpload2("img", @"C:UsersPublicPicturesSample PicturesDesert.jpg", "image/jpeg"); req.ContentType = "multi part/form-data; boundary=---------------------------" + rand(13); req.AddHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"); req.AddHeader("Accept-Encoding", "gzip, deflate"); req.AddHeader("Accept-Language", "en-US,en;q=0.5"); req.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0"); resp = http.SynchronousRequest(domain, 80, false, req);


It is impossible to answer this question because it has not been communicated in an intelligible or readable manner.