473,322 Members | 1,403 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,322 software developers and data experts.

Post errors

I don't get any further on this - pleas help me :)

In c# I'm using the httpWebRequest object to post a word-document along
with some parameters to a server. My challenges are:

1. When creating the requestStream object and write to it the message
is posted without the
credentials. I get an unauthorized error from the server: HTTP/1.1
401 Unauthorized.

2. When I ask for the response on the requesobject (httpWebResponse =
HttpWebResponse)
httpWebRequest.GetResponse(); --> this time the credentials are
posted as well and I get
another error from the server: HTTP/1.1 500
Multipart+request+expected

Why does my code post two times??
What does the multipart+request+expected error mean??

I'll be very greatfull for any contribution!

neoret

May 15 '06 #1
2 1166
When you use an HTTP Post request to upload a file, the Request must have an
enctype of "multipart/form-data". In addition, there must be a boundary
identifying the file(s) to be uploaded. The binary data must be
Base64-encoded. It's rather complex. See the following RFCs for more
information:

http://www.faqs.org/rfcs/rfc1867.html
http://www.faqs.org/rfcs/rfc1521.html
http://www.faqs.org/rfcs/rfc1522.html

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

<ne****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
I don't get any further on this - pleas help me :)

In c# I'm using the httpWebRequest object to post a word-document along
with some parameters to a server. My challenges are:

1. When creating the requestStream object and write to it the message
is posted without the
credentials. I get an unauthorized error from the server: HTTP/1.1
401 Unauthorized.

2. When I ask for the response on the requesobject (httpWebResponse =
HttpWebResponse)
httpWebRequest.GetResponse(); --> this time the credentials are
posted as well and I get
another error from the server: HTTP/1.1 500
Multipart+request+expected

Why does my code post two times??
What does the multipart+request+expected error mean??

I'll be very greatfull for any contribution!

neoret

May 15 '06 #2
Thus wrote Kevin,
When you use an HTTP Post request to upload a file, the Request must
have an enctype of "multipart/form-data". In addition, there must be a
boundary identifying the file(s) to be uploaded. The binary data must
be Base64-encoded. It's rather complex. See the following RFCs for
more information:

http://www.faqs.org/rfcs/rfc1867.html
http://www.faqs.org/rfcs/rfc1521.html
http://www.faqs.org/rfcs/rfc1522.html


Note that WebClient.UploadFile() implements "multipart/form-data" encoded
requests.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
May 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
<? class ErrorMsgCollection { var $name; var $mandatory; var $emptyErr; var $maxLength; var $maxLengthErr; var $minLength; var $minLenghtErr;
5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
1
by: Aliandro | last post by:
Hi I am really stuck and need some expertise help please. I have an XML file: <XML> <USER_INFO> <USERNAME>username</USERNAME> <PASSWORD>password%</PASSWORD> </USER_INFO> <SITE_INFO>...
10
by: wolfing1 | last post by:
I am creating an asp page to collect username/password from the user and validate it against the DB. Problem is, it's like this: - Page initially shows user and pwd inputs with a submit button -...
2
by: David Tilman | last post by:
I'm new to ASP .NET and have run into a problem. I have a child page open in a web application that the user adds information to and then clicks the save button. The information is added to a...
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
3
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
8
by: BiT | last post by:
Hello, I'm working right now on project in vb.net 2005 for my company, i need the project to download file from the company web site. In order to get the file i have to give the site address...
1
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.