The ComLessUpload class is a solution for uploading files to your server without the need for a server-side ASP Component (COM). The class has been tested with files upto 8mb and worked quickly and well. The original idea was taken from a script written by Matt Hart (
www.blackbeltvb.com).
Methods: comlessupload.GetFileName(field)
Retrieves the filename of the field, specified with field, if the form has been posted.
comlessupload.Save(directory, field, overwrite)
Saves the file uploaded in form field denoted by the 'field' parameter, to the directory specified by 'directory'. Set overwrite to true if you want to overwrite the file, if it exists.
comlessupload.SaveAs(filename, directory, field, overwrite)
Saves the file uploaded in form field denoted by the 'field' parameter, to the directory specified by 'directory', with 'filename' parameter. Set overwrite to true if you want to overwrite the file, if it exists
Example
The example shows you to use the class to save an upload file with its original filename, and with a different filename, overwriting the file if it exists in both cases. There is no need to check if the form has been posted - this is checked in the class. The example includes the html for the form below the ASP code.