|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to HTTP post multiple files and key-value pairs?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! 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! > 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! >> > > 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 --- 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! > |
|||||||||||||||||||||||