ASMX file upload

Sure:

[WebMethod]
public void Upload(byte[] contents, string filename)
{
    var appData = Server.MapPath("~/App_Data");
    var file = Path.Combine(appData, Path.GetFileName(filename));
    File.WriteAllBytes(file, contents);
}

then expose the service, generate a client proxy from the WSDL, invoke, standard stuff.

--

UPDATE:

I see your update now about handling large files. The MTOM protocol with streaming which is built into WCF is optimized for handling such scenarios.


When developing my free tool to upload large files to a server, I am also using .NET 2.0 and web services.

To make the application more error tolerant for very large files, I decided to not upload one large byte[] array but instead do a "chuncked" upload.

I.e. for uploading a 1 MB file, I do call my upload SOAP function 20 times, each call passing a byte[] array of 50 KB and concating it on the server together again.

I also count the packages, when one drops, I try to upload it again for several times.

This makes the upload more error tolerant and more responsive in the UI.

If you are interested, this is a CP article of the tool.