Re: HTTPWebRequest - Programatically Uploading Text File with POST



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/microsoft.public.dotnet.framework.aspnet/msg/5d13224a77b89add

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





"Paul" <Paul@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:041D50EB-F91C-40DA-A5EB-F1E682A2F3D7@xxxxxxxxxxxxxxxx
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



.