Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to use the function directly Pin
luming11223344556-Jul-04 21:46
luming11223344556-Jul-04 21:46 
Generalvga output from PPC using C# Pin
wilk00776-Jul-04 16:19
wilk00776-Jul-04 16:19 
GeneralSearch Command Pin
Anonymous6-Jul-04 15:19
Anonymous6-Jul-04 15:19 
GeneralRe: Search Command Pin
insurgentpyro6-Jul-04 18:54
insurgentpyro6-Jul-04 18:54 
GeneralRe: Search Command Pin
hpAng6-Jul-04 21:30
hpAng6-Jul-04 21:30 
GeneralRe: Search Command Pin
Heath Stewart7-Jul-04 4:26
protectorHeath Stewart7-Jul-04 4:26 
GeneralHttpWebRequest Pin
Moon Boy6-Jul-04 14:23
Moon Boy6-Jul-04 14:23 
GeneralRe: HttpWebRequest Pin
Heath Stewart7-Jul-04 4:19
protectorHeath Stewart7-Jul-04 4:19 
Take a look at RFC 1867[^] which describes file uploads using HTTP.

For example, if you only need to upload a single plain text file, you cn set the HttpWebRequest.ContentType to "multipart/form-data; boundary=ABC123". You then get the request stream using HttpWebRequest.GetRequestStream and, to make things easier, pass that to a StreamWriter with whatever Encoding is appropriate (should be the same as the file encoding you're uploading, though multiple parts can have different encodings that would go into the "Content-type" header as "charset". You would write to the request stream writer like so:
--ABC123
Content-type: application/x-www-form-urlencoded
 
param1=value1&param2=value2
--ABC123
Content-disposition: form-data; name="FileField"
Content-type: text/plain
 
This content is from a text document.
--ABC123--
Notice the intentional line breaks and how the last line ends with -- (the end of the MIME boundary).

Learning this is crucial to understanding how to HTTP and MIME works, and the RFC is actually quite easy to read (compared to many others I've read).

 

Microsoft MVP, Visual C#
My Articles
Generalneed sp_helpdb return values Pin
betterc6-Jul-04 14:06
betterc6-Jul-04 14:06 
GeneralRe: need sp_helpdb return values Pin
leppie6-Jul-04 14:55
leppie6-Jul-04 14:55 
GeneralRe: need sp_helpdb return values Pin
betterc6-Jul-04 14:57
betterc6-Jul-04 14:57 
GeneralRe: need sp_helpdb return values Pin
betterc7-Jul-04 1:20
betterc7-Jul-04 1:20 
GeneralRe: need sp_helpdb return values Pin
Heath Stewart7-Jul-04 3:56
protectorHeath Stewart7-Jul-04 3:56 
GeneralRe: need sp_helpdb return values Pin
betterc7-Jul-04 6:19
betterc7-Jul-04 6:19 
GeneralRe: need sp_helpdb return values Pin
Heath Stewart7-Jul-04 8:19
protectorHeath Stewart7-Jul-04 8:19 
GeneralShoModaDialog Pin
IamADotNetGuy6-Jul-04 13:06
IamADotNetGuy6-Jul-04 13:06 
GeneralRe: ShoModaDialog Pin
Heath Stewart7-Jul-04 3:41
protectorHeath Stewart7-Jul-04 3:41 
GeneralRe: Problems compiling class library Pin
leppie6-Jul-04 14:58
leppie6-Jul-04 14:58 
General4 different random numbers Pin
insurgentpyro6-Jul-04 11:20
insurgentpyro6-Jul-04 11:20 
GeneralRe: 4 different random numbers Pin
Christian Graus6-Jul-04 11:57
protectorChristian Graus6-Jul-04 11:57 
GeneralRe: 4 different random numbers Pin
insurgentpyro6-Jul-04 18:50
insurgentpyro6-Jul-04 18:50 
GeneralRe: 4 different random numbers Pin
Christian Graus7-Jul-04 12:22
protectorChristian Graus7-Jul-04 12:22 
GeneralRe: 4 different random numbers Pin
Anonymous7-Jul-04 17:51
Anonymous7-Jul-04 17:51 
GeneralRe: 4 different random numbers Pin
Arjan Einbu6-Jul-04 12:29
Arjan Einbu6-Jul-04 12:29 
GeneralRe: 4 different random numbers Pin
insurgentpyro6-Jul-04 18:52
insurgentpyro6-Jul-04 18:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.