|
|
|
|
![]() ![]() |
Sep 10 2005, 04:09 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
This is my first time playing with cffile. I have the code working where the file gets uploaded to a folder on the server. Now I'd like to move it to a folder elsewhere where folks can access it. My problem is that I can't figure out how to reference the variable that holds the name of the file once it's been uploaded. I feel like an idiot because it should be something simple but it's not coming to me and nothing I try will work. How do you reference the filename once it's been uploaded?
Thanks for any help! Here is the code on the submit page: Code: CODE <FORM ACTION="UploadSubmit.cfm" METHOD="POST" name="UploadForm" enctype="multipart/form-data"> <input type="file" name="UploadFile" id="UploadFile" size="40"> <input type="submit" name="UploadSubmit" id="UploadSubmit" value="Submit"> </FORM> And here is the code on the action page: Code: CODE <cfif ISDEFINED("form.UploadSubmit")> <cffile action="upload" filefield="UploadFile" destination="D:\DocLibrary\Docs" nameconflict="makeunique"> <cffile action="move" source="D:\DocLibrary\Docs\#????#" destination="F:\DocumentLibrary"> </cfif> Thanks,kvarnerexpress |
|
|
|
Nov 4 2005, 03:59 AM
Post
#2
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 15 Joined: 4-November 05 Member No.: 13,784 |
After you upload a file, quite a number of cffile "status variables" are available to you. Some of the ones you will probably be interested in are (snipped from the Macromedia docs):
serverDirectory Directory of the file saved on the server serverFile Filename of the file saved on the server serverFileExt Extension of the uploaded file on the server (without a period) serverFileName Name of the uploaded file on the server (without an extension) A little bit of experimentation with these should allow you to do what you want. HTH |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 25th July 2008 - 10:25 AM |