🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.pl.comp.lang.csharp
1 messages
1 total messages Started by amine Fri, 05 Sep 2003 04:00
Senior Thesis: please help (uploading a file from HTTP server)
#32
Author: amine
Date: Fri, 05 Sep 2003 04:00
36 lines
2137 bytes
Hi all,

I have been developing an application for an IPAQ.
I am trying to write some code that will allow the user to
upload files to an HTTP server. I of course can't use the
webclient class since it is not supported by the compact
framework.
is there anyway I can use the webrequest and webresponse
classes to upload files from the httpserver.

I got this snippet of code from a site but it doenst work:

HttpWebRequest req = (HttpWebRequest)WebRequest.Create
                     (url);
req.Method = "put";
String temp_file_content ="file content";

byte[] encoded_content = Encoding.UTF8.GetBytes
                         (temp_file_content);
req.ContentLength  = encoded_content.Length;

Stream request_stream = req.GetRequestStream();
request_stream.Write (encoded_content, 0 ,
                      encoded_content.Length);
request_stream.Close();
HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
resp.Close();

I also want to actually upload files not only strings. Is
there anyways I can do that without using the webclient
class

PLEASE any help is very appreciated since I have looked
all over and couldnt find anything. I am very desperate

Thank You.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads