Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE UPLOAD TO SPECIFIC DIRECTORY

Status
Not open for further replies.

kingjjx

Programmer
Joined
Sep 18, 2001
Messages
181
Location
US
I am trying to make an upload page, but I want the users to be able to choose which directory to upload their file.

EXAMPLE: (a user with a honda bike, model-234 can click on bikes .. then it will provide the different folders within bike and he can then choose model-234 and upload his file to this folder)

BIKES
|-- honda
| |--Model-234
| |--Model-789
|-- yamaha
| |--Model-xyz
| |--Model-crx
|-- Suzuki


how do i do this ???
any help will be much appreciated.

thanks
-jon
 
You could put a radio button next to each directory/subdirectory and pass that to the page that uploads the file -- then use that to specify the upload directory in the cffile tag.

e.g,
Bikes --
--- Honda
-----<input type=&quot;radio&quot; name=&quot;SubDir&quot; value=&quot;honda\model-234&quot;> model-234
-----<input type=&quot;radio&quot; name=&quot;SubDir&quot; value=&quot;honda\model-789&quot;> model-789
etc...

Then on the upload page put:
<cffile action=&quot;Upload&quot; file=&quot;#form.FileFieldName#&quot; Destination = &quot;c:\Bikes\#form.SubDir#&quot;>
etc..

HTH,
Tim P.

 
Just another suggestion, although I'm not sure how easy it is (as I've never used it): CFTREE and CFTREEITEM can be used to create a navigation tree similar to that in windows explorer. Visitors can select the folder they want, and you can pass a variable from the tree to use as the upload directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top