Dundas File Upload - Client Side Restricted Access Pages

By Robbe D. Morris

Printer Friendly Version

Robbe Morris
Robbe & Melisa Morris

I recently needed to build a process in which users could upload their own content that would then be interwoven with existing content on the site.  Giving the users an FTP client wasn't feasible as the users didn't necessarily all have FTP client software nor did I want to give them wide open access to upload just anything...  One of my primary concerns was to restrict the type of files uploaded along with checking for harmful code inside the files.  As part of the user experience, I've also included code to show actual disk space used .v allowed.  The entire code set has been included along with the free Dundas Upload Component that will need to be installed on the web server (ASPUpload.exe).

Instructions
Unzip the contents of the .zip file in the root directory of your test site.
Install the Dundas Upload software on the web server or on your local PC if you want to test this using PWS.
Open the "FileTransferFunctions.asp" and set the variables in the indicated section (this is defining paths the upload functions will use).
Run the default.asp page.  I've included a couple of sample files and folders for you to work with.

You'll want to "pretty" the pages up a bit but the entire functionality for uploading, downloading, and deleting files is all fully functional.  It was also written to allow you to make some fairly minor adjustments to suit your needs.  ** Be aware that any file/folder worked with on your production server will need to be granted read/write/modify rights to the IUSR account you use for standard internet access in order for the pages to work properly.  Dundas offers an impersonate user functionality if you need that.  Personally, I've dedicated a parent folder for the whole process and granted rights to it and let those rights propogate to the child folders/files for ease of administration.

Download Code


Robbe has been a Microsoft MVP in C# since 2004.  He is also the co-founder of EggHeadCafe which provides .NET articles, book reviews, software reviews, and software download and purchase advice.