Home All Groups Group Topic Archive Search About

how to HTTP post multiple files and key-value pairs?

Author
23 Apr 2007 7:33 AM
Lloyd Dupont
Hi!

I am a bit lost. I want to upload multiple files and key-value pairs via
HTTP post.

A single file and a single collection of key-value pairs is easy. You just
have to use the System.Net.WebClient class and its UploadFile, UploadValues
method.

Can anyone explain to me how to post both files and values with one request?
I would very much appreciate any hint!

Author
24 Apr 2007 5:56 AM
RobinS
Hey, Lloyd, this is a pretty inactive group. You might try posting to the
C# or VB group.  (microsoft.public.dotnet.languages.csharp and the same
with vb instead of csharp -- haven't I seen you there?)


Robin S.
-----------------------
Show quote
"Lloyd Dupont" <net.galador@ld> wrote in message
news:uJl%238mXhHHA.4064@TK2MSFTNGP03.phx.gbl...
> Hi!
>
> I am a bit lost. I want to upload multiple files and key-value pairs via
> HTTP post.
>
> A single file and a single collection of key-value pairs is easy. You
> just have to use the System.Net.WebClient class and its UploadFile,
> UploadValues method.
>
> Can anyone explain to me how to post both files and values with one
> request? I would very much appreciate any hint!
>
Author
24 Apr 2007 5:57 AM
RobinS
Oh! I didn't realize you cross-posted it. Never mind!

Robin
-------------------------
Show quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:77CdnfUMzOSYAbDbnZ2dnUVZ_rCsnZ2d@comcast.com...
> Hey, Lloyd, this is a pretty inactive group. You might try posting to the
> C# or VB group.  (microsoft.public.dotnet.languages.csharp and the same
> with vb instead of csharp -- haven't I seen you there?)
>
>
> Robin S.
> -----------------------
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:uJl%238mXhHHA.4064@TK2MSFTNGP03.phx.gbl...
>> Hi!
>>
>> I am a bit lost. I want to upload multiple files and key-value pairs via
>> HTTP post.
>>
>> A single file and a single collection of key-value pairs is easy. You
>> just have to use the System.Net.WebClient class and its UploadFile,
>> UploadValues method.
>>
>> Can anyone explain to me how to post both files and values with one
>> request? I would very much appreciate any hint!
>>
>
>
Author
28 Apr 2007 3:40 AM
Rick Strahl [MVP]
If you need to post data to the server it might be easier to use
HttpWebRequest. I wrote an article and a wrapper class that handles these
aspects easily here a few years back:

http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm

You can use AddPostFile and AddPostKey in combination with the class to
upload files and form vars.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com/weblog


Show quote
"Lloyd Dupont" <net.galador@ld> wrote in message
news:uJl%238mXhHHA.4064@TK2MSFTNGP03.phx.gbl...
> Hi!
>
> I am a bit lost. I want to upload multiple files and key-value pairs via
> HTTP post.
>
> A single file and a single collection of key-value pairs is easy. You just
> have to use the System.Net.WebClient class and its UploadFile,
> UploadValues method.
>
> Can anyone explain to me how to post both files and values with one
> request? I would very much appreciate any hint!
>

AddThis Social Bookmark Button