Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Help With Cffile Move

Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.