May 16, 2008

Help With Cffile Move

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > ColdFusion Programming

free web hosting

Help With Cffile Move

kvarnerexpress
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

 

 

 


Reply

mcfly
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : cffile


    Looking for cffile, move

Searching Video's for cffile, move
advertisement



Help With Cffile Move



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE