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

HTTPWebRequest - Programatically Uploading Text File with POST

P: n/a
I need to programatically upload a text file to a web server using the
HTTPWebRequest object within .Net 2.0.

So far, I have determined that:

- I need a HTTP content-type of "multipart/form-data".
- I need to use the ContentType.Boundary property.

That is about as far as I have gotten.

I have searched long and far for examples to do this in .Net but I can not
seem to find anything?

Does anyone have a code example or URL that I can look at to put the pieces
of the puzzle together?

TIA
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I forgot to add that this must all be done programatically.

No user interface, no client.

I retrieve the data that I want to upload programatically and I must somehow
create a HTTPWebRequest that will use a POST request and the
"multipart/form-data" content type.

"Paul" wrote:
I need to programatically upload a text file to a web server using the
HTTPWebRequest object within .Net 2.0.

So far, I have determined that:

- I need a HTTP content-type of "multipart/form-data".
- I need to use the ContentType.Boundary property.

That is about as far as I have gotten.

I have searched long and far for examples to do this in .Net but I can not
seem to find anything?

Does anyone have a code example or URL that I can look at to put the pieces
of the puzzle together?

TIA
Jun 27 '08 #2

P: n/a
This might not be correct, but check here:
http://groups.google.com/group/micro...13224a77b89add

I have "POST" code somewhere in that helper I think.

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:04**********************************@microsof t.com...
>I forgot to add that this must all be done programatically.

No user interface, no client.

I retrieve the data that I want to upload programatically and I must
somehow
create a HTTPWebRequest that will use a POST request and the
"multipart/form-data" content type.

"Paul" wrote:
>I need to programatically upload a text file to a web server using the
HTTPWebRequest object within .Net 2.0.

So far, I have determined that:

- I need a HTTP content-type of "multipart/form-data".
- I need to use the ContentType.Boundary property.

That is about as far as I have gotten.

I have searched long and far for examples to do this in .Net but I can
not
seem to find anything?

Does anyone have a code example or URL that I can look at to put the
pieces
of the puzzle together?

TIA

Jun 27 '08 #3

P: n/a
This is similar to what I am looking for but it doesn't address uploading a
file.

I am pretty certain I need to use the HTTP content-type of
"multipart/form-data" to programatically duplicate the manual process of
uploading the file.


"sloan" wrote:
This might not be correct, but check here:
http://groups.google.com/group/micro...13224a77b89add

I have "POST" code somewhere in that helper I think.

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:04**********************************@microsof t.com...
I forgot to add that this must all be done programatically.

No user interface, no client.

I retrieve the data that I want to upload programatically and I must
somehow
create a HTTPWebRequest that will use a POST request and the
"multipart/form-data" content type.

"Paul" wrote:
I need to programatically upload a text file to a web server using the
HTTPWebRequest object within .Net 2.0.

So far, I have determined that:

- I need a HTTP content-type of "multipart/form-data".
- I need to use the ContentType.Boundary property.

That is about as far as I have gotten.

I have searched long and far for examples to do this in .Net but I can
not
seem to find anything?

Does anyone have a code example or URL that I can look at to put the
pieces
of the puzzle together?

TIA


Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.