Uploading Files with ASP

Compiling the component

Phew... that was an awful lot of code to get through. Obviously, we haven't covered every line, but hopefully by now you should get the idea. The clsFormField object is basically used to store information about that field. A standard field will simply have it's name and value recorded. Meanwhile, a file also has a FileSize, ContentType and FileName property. Once parsed, our ASP script can then access all this information, and use the cFormField object's SaveFile method to save each file to the server's hard disk. This will be demonstrated on the next page.

First, however, we need to compile our component to a DLL file. To do this, go to File | Make ASPUploadComponent.dll . Before it can be used in your ASP script, however, IUSR_COMPUTERNAMEneeds to be given permission to access the file (and lock it!). To do this, display the file properties from explorer, and give IUSR_COMPUTERNAME read/execute permissions. Now, we are ready to create our other asp page.

You might also like...


About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It works on my machine.” - Anonymous