[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now



Posted on 2006-03-21
Medium Priority
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
  • 2
LVL 28

Accepted Solution

sybe earned 2000 total points
ID: 16266599
> 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

ID: 16275991
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

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

872 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