I want to implement functionality to upload files to box.And it requires a multipart post request.I am using .net 3.5, so I can't use HttpClient. Also, I want to implement it using webclient as it allows to track progress and I want to show the progress in the UI. I have to send {"name":"tigers.jpeg", "parent":{"id":"xxxxx"}}
as parameter along with the file to be uploaded.How do I create such a request, which also allows me to track progress.
Asked
Active
Viewed 570 times
0

V K
- 1,645
- 3
- 26
- 57
-
You must use an HttpWebRequest to make complex POST's, you can track the progress just by yourself as you're the one who will send the content's data. – Gusman Apr 26 '16 at 13:55
-
But how do I send a Multipart request from HttpWebRequest. – V K Apr 27 '16 at 06:25
-
You need to create an stream, add the appropiate headers and write the data to the stream, take a look at this: http://www.briangrinstead.com/blog/multipart-form-post-in-c – Gusman Apr 27 '16 at 17:24