kvarnerexpress 0 Report post Posted September 10, 2005 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: <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:<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 Share this post Link to post Share on other sites
mcfly 0 Report post Posted November 4, 2005 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 Share this post Link to post Share on other sites