We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

AUTO-CREATE A DIRECTORY WITH IMAGE UPLOAD (PURE ASP UPLOAD).

lshane
lshane asked
on
Medium Priority
345 Views
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
PureUploadSetup
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.
Comment
Watch Question

Commented:
> 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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
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

Commented:
Thanks, sybe.  I changed my system.  Works much better.  Thank you.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.