File upload using c# application to an asp on the server

  • Thread starter Thread starter John Woo
  • Start date Start date
J

John Woo

How do I upload a file to an ASP page using a C# application(client).
The client side is c# application which takes the filename.
and the server side is written in asp.


John
 
John,

You have a few ways to go with this.

On the client side, you can use the HttpWebRequest class to issue the
request to the server, transmitting the file to the server through that. An
easier way to do this would be to use the WebClient class, which has methods
specifically for uploading a file (using the POST or PUT method).

On the server side, you might not need ASP.NET at all. You can
configure IIS so that it will accept files (through the PUT method) and
place them in the directory that the url requested points to. Or, you can
create an ASP.NET page, and then access the Files property on the
HttpRequest exposed by the Request property on the Page object. It will
have the contents of the files uploaded to the server.

Hope this helps.
 
Back
Top