Programmatic file upload to web server

  • Thread starter Thread starter Raghu
  • Start date Start date
R

Raghu

I need to programmatically upload some files (may contain binary data) to
internal web servers. These are not exposed to internet. I am looking for a
solution that would enable me to do this.

I checked out HtmlInputFile control. It is geared towards interactive users.
I am looking for a programmatic way of doing this without involving users.

Appreciate any input.

Thanks.
Raghu/..
 
Raghu said:
I need to programmatically upload some files (may contain binary data) to
internal web servers. These are not exposed to internet. I am looking for a
solution that would enable me to do this.

I checked out HtmlInputFile control. It is geared towards interactive users.
I am looking for a programmatic way of doing this without involving users.

Appreciate any input.

Web service is one easy way, or you can use ftp but I don't think dot net has direct support for it. You can create a file upload
page and programtically upload to it but I'm not sure how hard that is.
 
How do you use web service for this?

Michael Culley said:
Web service is one easy way, or you can use ftp but I don't think dot net
has direct support for it. You can create a file upload
 
Raghu said:
How do you use web service for this?

In the simplest incarnation just add a web service to your web project and add something like this

[WebMethod]
public void SendFile(byte[] Data)
{
//code to save Data to file
}

Then on the other side just add a web reference and call this method.

If the size of the file gets big you might want to create a SendChunk method and send it over in multiple calls.
 
OK. I will test this.

Thanks for the idea.

Michael Culley said:
How do you use web service for this?

In the simplest incarnation just add a web service to your web project and add something like this

[WebMethod]
public void SendFile(byte[] Data)
{
//code to save Data to file
}

Then on the other side just add a web reference and call this method.

If the size of the file gets big you might want to create a SendChunk
method and send it over in multiple calls.
 
Back
Top