473,320 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

HTTPWebRequest - Programatically Uploading Text File with POST

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
3 4206
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
1
by: Joey Chömpff | last post by:
Hello, When I'm uploading an file to a JRun WebServer (third party) with a Windows Forms application, l always get an TimeOut while uploading, all other request who doesn't request an post are...
2
by: parseint | last post by:
Hi, Im trying to send a files using a HTTP POST request in my Window Application. I also have a progressbar that is being updated whil uploading. I have managed to send a file using HTTP PUT,...
4
by: Shannon Hardin | last post by:
I'm trying to build a routine that will take a specified file from the user's local hard drive, and copy it to a remote server via WebDAV. I've tried using both HttpWebRequest and FileWebRequest,...
0
by: boxboy | last post by:
Hi, I'm writing a console application and am having a problem with HttpWebRequest when posting data to a webserver. A "System.Net.WebException: The server committed a protocol violation" is always...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
1
by: Proogeren | last post by:
I have a problem with a httpwebrequest that I am creating. The request in itself looks correct but using fiddler I see that a www-authentication header is sent along as well. The code is pasted...
5
by: kamlesh20J | last post by:
Hello, I am trying to use HttpWebRequest to send some POST data I have accomplished this using: HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://mysite.com/index.php");...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.