Lewis Moten

Upload Files Without COM

Classic ASP file uploads, 2001 to 2003

The Upload Files Without COM version 3 example page.

A pure-ASP parser for multipart form uploads, so a site on IIS could accept files without buying a COM component.

Executive summary

Why it exists

In 2001, accepting an upload in classic ASP on IIS meant buying a component from one of two companies, about $700, and finding a host willing to install a DLL.

Outcome

It was my most famous published code and won an award on Planet Source Code. By the end of 2010, version 2's page there had been read 210,297 times, rated by 50 users and drawn 231 comments from 2002 to 2010. Developers kept recommending it for years: an OpenWiki attachment patch on SourceForge (2003) was built on it, a WebmasterWorld reader pointed others to it in 2006, a developer on the evolt.org list said in 2008 that they had used it on several client sites, and a 2012 Stack Overflow answer to "How to upload files with asp-classic" (now over 100,000 views) used it, with "solution credit goes to Lewis Moten".

My role

Author. Three versions: January 2001, March 2002, September 2003.

Technical overview

How it works

I read the RFC for multipart form uploads and wrote a parser in plain ASP. It saved files to disk or to a database, for free. Version 1 (1/13/2001) used classes instead of dictionary objects. Version 2 (3/20/2002) was faster, fixed bugs and commented every step. Version 3 (9/1/2003) has an object-oriented interface, saves binary data through ADODB, manages memory so larger files work, shows a real-time progress bar, and comes with a FAQ and a support site.

Hard parts

Parsing raw binary form data with only what a shared host already had, and keeping memory in check for large files.

Stack

  • Classic ASP
  • VBScript
  • ADODB