Pure ASP.NET Upload for Dreamweaver MX

Welcome to the tutorials of Pure ASP.NET Upload.

What will you learn:

  • How to create a file upload 
  • restrict certain files or sizes of files from being uploaded
  • upload files and insert them in a database
  • and much more...

Pure ASP.NET Upload - Upload to Organized Folder

Upload to an Organized Folder

Many users have asked me how to use this new feature of Pure ASP.NET Upload for organizing the uploaded files in different folders. In this tutorial I will explain how this is accomplished.

In sites where many files are going to be uploaded you often need a better way to organize them then to just upload them all in one and the same folder.

Lets take an intranet site where you will be uploading photo's of all employees as an example. You want those photo's to be organized in different folders depending on the employee's department. The folder structure you want might look like this:


Previous TutorialTutorials IndexNext Tutorial

How to do it

To make the file upload to an organized folder, you need to:

  1. Start with a basic upload page

    Start with an upload page with the Pure ASP.NET Upload extension in place. If you haven't done this yet, go through the Simple file upload tutorial.

  2. Extend the upload form with Department selection field

    You can now edit the basic form and add some more form fields to it:



    As you can see I've added a Department field. This is a drop down list that includes all the departments we have. As values I've selected the same strings as the department names. I will use the name of the department to make the upload folder name.

  3. Open the Pure ASP.NET Upload dialog

    Select the Pure ASP.NET Upload dialog by opening the Server Behaviors panel. Select DMXzone - Pure ASP.NET Upload.

  4. Enter the variable folder
  5. When you need to use a variable folder, you can enter any expression you want in the Upload Folder field. In my example another form field contains the Departments.

    So I need the following upload folder expression:

    "Employees/" .$HTTP_POST_VARS['Department']

    this will create a new directory for every non existed department and will place the photos of each employee that belongs to that department there! Non existent folders will be auto-created so this is really powerful! You only need to setup the security on the main Upload folder, for more info how to do this read the Setting the folder security on your server tutorial.

    You might also check the Prefix With Full Path option. This option will store the full path in your database (if you are saving the filename in a database). So it will be easy to retrieve a list of all files later on.

  6. Save and done
  7. Save your page and upload it to your server, and you are done! Go to your website and test it - you should be able to upload any file to a dynamic folder.

Previous TutorialTutorials IndexNext Tutorial

George Petrov

George PetrovGeorge Petrov is a renowned software writer and developer whose extensive skills brought numerous extensions, articles and knowledge to the DMXzone- the online community for professional Adobe Dreamweaver users. The most popular for its over high-quality Dreamweaver extensions and templates.

George is also the founder of Wappler.io - the most Advanced Web & App Builder

See All Postings From George Petrov >>

Comments

Set FTP permissions using ASP?

March 31, 2008 by student 101

 

How to set (FTP) permissions on certain folders using ASP?
I have no problems doing this in PHP.

How to do it in ASP?
(CHMOD 0777 then CHMOD 0755 after your'e done with the uplaod?)

Cheers

You must me logged in to write a comment.