473,608 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 (httpWebRespons e =
HttpWebResponse )
httpWebRequest. GetResponse(); --> this time the credentials are
posted as well and I get
another error from the server: HTTP/1.1 500
Multipart+reque st+expected

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

I'll be very greatfull for any contribution!

neoret

May 15 '06 #1
2 1177
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.c om> wrote in message
news:11******** **************@ v46g2000cwv.goo glegroups.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 (httpWebRespons e =
HttpWebResponse )
httpWebRequest. GetResponse(); --> this time the credentials are
posted as well and I get
another error from the server: HTTP/1.1 500
Multipart+reque st+expected

Why does my code post two times??
What does the multipart+reque st+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.Uploa dFile() implements "multipart/form-data" encoded
requests.

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

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

Similar topics

1
1879
by: Phil Powell | last post by:
<? class ErrorMsgCollection { var $name; var $mandatory; var $emptyErr; var $maxLength; var $maxLengthErr; var $minLength; var $minLenghtErr;
5
4251
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 second form when it is called. Both forms are .htm files that call themselves when the submit button is press via the following command in each form: <form method="post" action="<?php $server?>">
1
5473
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> <SITE_NO>18856</SITE_NO> </SITE_INFO>
10
1536
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 - Page submits to itself using POST method - Now armed with user and password, using ADO I verify information against database and if it's correct, the main page shows. Two problems: 1) is the password information secure when I use 'post'? can...
2
1789
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 databse. If there is a problem with adding the record to the database, I want to display the error message on the page after post back from clicking the save button. If there are no errors I want the child window to close after the post back. I...
16
4970
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 set the POST limit in php.ini to 8 megs. What reasons, other than the POST limit, would a large upload fail?
3
2330
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 using ADO. I'm getting sometimes correct values, sometimes null values (when I know I pass a valid default value) and other times multiple values! I know what the values coming over are because I do a response.write to see it before the error...
1
2818
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 enter input. I need to take this user input and put it back into the database. What would be the best method to do this. I can't use a normal post because the name of the text box is the same for each table row. I've heard that posting the...
8
2987
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 http://www.somthing.com and then send to the server post data like "&d=10202" to get the file. i've search google and newsgroups but I didn't find anything to solve my problem, I found this example...
1
4874
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 program,which can upload many file in folder.problem is,am unable to save my file name in to database.because i used same name for all input file type as file. i dont know get name of file.below i presented my coding for ur view.fed up with my coding..pls...
0
8063
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8498
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8478
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8152
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6817
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1598
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.