By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,204 Members | 1,469 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,204 IT Pros & Developers. It's quick & easy.

Uploading a document using http post

P: n/a
Hi there.

I need to perform an upload of a document using HTTP post. This has to
be done from my windows form using C#.

My challenge is:
1: To send - the word document
2: To attach several variables to the same request
3: To handle the response.
4: To authenticate my request by adding a username and pasword.

I found out that the webclient isn't complex enough. I guess I have to
use the httpWebrequest.

Thank you in advance for your contribution!!

Neoret

May 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Neoret,

If it wasn't for #2, you could actually use WebClient for all of this.

If you are going to use HttpWebRequest, then you will have to handle all
of the uploading code yourself, meaning, you have to write the name/value
pairs, the boundaries, the content length, etc, etc.

All in all, it's quite a task.

I would look at the HTTP specification for how to do this, either that,
or dig through the WebClient class with reflector and find out how they are
doing it for the UploadValues and UploadFile method and do it yourself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ne****@gmail.com> wrote in message
news:11*********************@j73g2000cwa.googlegro ups.com...
Hi there.

I need to perform an upload of a document using HTTP post. This has to
be done from my windows form using C#.

My challenge is:
1: To send - the word document
2: To attach several variables to the same request
3: To handle the response.
4: To authenticate my request by adding a username and pasword.

I found out that the webclient isn't complex enough. I guess I have to
use the httpWebrequest.

Thank you in advance for your contribution!!

Neoret

May 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.