Posted on 2006-03-21
Last Modified: 2012-05-05
Hello.  I am using ASP VBSCRIPT (not .NET).
I am also using an upload extension name PURE ASP UPLOAD.

I know this is a particular brand, but I wanted to know if someone could help me manipulate the upload code just a little.  It seems it may be simple, but I'm not certain.

This upload extension will provide the code to auto-create a directory upon upload, if the directory does not already exist.  It works fine with one directory; however, I would like to auto-create a directory within a directory.  I pasted the code below, and the path has the directory/directories pulling from 2 form menu fields.  The syntax is probably what I'm not entering correctly.  As it is, it uploads, but only creates one directory while combining both record numbers together as the directory name.

(Example: When only uploading one directory, the correct result would be that the directory would be named whatever the "value" of the form field is.  In this case, the "category" field has a value of the Record number (1, 2, etc.).  I'm trying to create ANOTHER directory within that directory, with the same naming scheme.  So, it should upload and create the first directory with a name from the "value" being (1, 2, 3, etc.), then the 2nd directory would be named the "value" of the "subcategory" field (1, 2, 3, etc.).  As it is listed below, it combines the 2 "values" to create one name for the one directory.  

If the "value" from the menu field "category" is "5" and the "value" for the "subcategory" menu field is "1", it creates one directory named "51".)

I thought perhaps someone could, possibly, know how ASP does this and would be able to assist me with altering the code.

Here's the code: (I separated the "path" line from the rest for easier visibility).
'*** Pure ASP File Upload 2.2.1
Dim GP_uploadAction,UploadQueryString
If (CStr(Request.QueryString("GP_upload")) <> "") Then
  Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight

pau_thePath = """../images/scapeImages/"" & UploadFormRequest(""category"") & UploadFormRequest(""subcategory"")"

  pau_Extensions = "GIF,JPG,JPEG,BMP,PNG"
  pau_Form = "form1"
  pau_Redirect = ""
  pau_storeType = "path"
  pau_sizeLimit = ""
  pau_nameConflict = "over"
  pau_requireUpload = "true"
  pau_minWidth = ""
  pau_minHeight = ""
  pau_maxWidth = ""
  pau_maxHeight = ""
  pau_saveWidth = ""
  pau_saveHeight = ""
  pau_timeout = "600"
  pau_progressBar = "showProgress.htm"
  pau_progressWidth = "300"
  pau_progressHeight = "100"
  Dim RequestBin, UploadRequest
  CheckPureUploadVersion 2.21
  ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if


Thanks so much.
Question by:lshane
    LVL 28

    Accepted Solution

    > If the "value" from the menu field "category" is "5" and the "value" for the "subcategory" menu field is "1", it creates one directory named "51".)

    So if the value from the category is "11" and the value from the subcategory is "2" it creates a directory named "112"
    And if the value of the category is "1" and the value of the subcategory is "12", it creates a directory named......: yes "112"

    You'll get in trouble with this system.


    Author Comment

    Understood.  I'll construct a different method.  Perhaps I'll just the uniqued ID the "name" of the category and/or subcategory.  I'm just afraid the user may create a typo and, thus, created another directory.

    Maybe I'll just hold to ONE main directory for "Category" and list all associated "Sub Category" images in there.

    Would you think that to be better?

    Author Comment

    Thanks, sybe.  I changed my system.  Works much better.  Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now