Chilkat Email Components Home

HTTP Upload

Back

In concept, an HTTP upload is very simple: a multipart/form-data POST HTTP request is sent to a web server, and then a handling program, whether it be an ASP or ASP.NET page, Perl script, CGI program, Ruby script, PHP script, etc, reads and parses the request, saves the file data to files on the web server, and responds with an HTTP response -- which could be a complete HTML page or some other response expected by an AJAX-type request.

The sending part can be nothing more than an HTML form, such as:

<html>
<body>
<form method="POST" enctype="multipart/form-data" action = "http://www.freeaspupload.net/freeaspupload/testUpload.asp">
<input name=attach1 type=file size=20><br> 
<input type=submit value="Test Upload"> 
</form>
</body>
</html>
In this case, the browser does all the work by creating a file selection dialog, opening and reading local files, and forming and sending the POST request to the HTTP server. If you already have the server-side implemented, you should be able to get this simple HTML to work with it. If you don't have the server-side implemented, you'll need to do it and it can be in anything you want. If it's ASP.NET, the server-side processing is typically placed in the same .aspx as the form that sends the HTTP upload.

If you're intent is for an end-user to use a browser displaying a multipart/form-data form to do the upload, then Chilkat HTTP is probably not your solution. If however, you want to write a program that runs server-side, as a service, or as a forms application, and you want the ability to create and send HTTP uploads and receive/parse HTTP responses (i.e. to do what the browser is doing), then Chilkat HTTP is for you.

There is no source code associated with this article.