|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
ColdFusion MX and FORM file oddity
I am using something relative to the following code:Jaye Morris - jayeZERO.com 12/05/02 09:47 A How are you getting this ?webguy 12/05/02 09:52 A You might want to try something like this instead:Peter Bagnato 12/05/02 10:43 A The variable you want to call is actuallyValerie L. Criswell 12/05/02 10:53 A I am using something relative to the following code: <form action="blahblahblah.cfm" method="post" enctype="multipart/form-data"> <input type="File" name="uploadedFileName"><br> <input type="Submit" value="Upload Now"> </form> During the process, I am attempting to catch the variable "uploadedFileName," but instead of getting a file name like myfilename.zip or whatever, I get something like: R:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\neotmp1 6991.tmp Being that neotmp16991.tmp is not the file name and is really something like myfilename.zip, how do I get that actual file name as opposed to what is seen above. -//- Jaye Morris - Multimedia Developer -//- jaye@navtrak.net - www.navtrak.net -//- jaye@jayezero.com - www.jayezero.com How are you getting this ? > R:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\neotmp1 > 6991.tmp This looks like the tmp file created before <cffile action=upload > Show us your blahblahblah.cfm template WG You might want to try something like this instead: <!---Code in the upload form---> <form enctype="multipart/form-data" action="upload_action.cfm" method="post"> File to upload: <input type="file" name="uploadfile" size="40"> <input type="submit" name="Upload" value="Upload"> </form> <!--- code in the action form---> <cffile action="upload" filefield="UploadFile" destination="d:\temp\" nameconflict="unique"> File uploaded successfully: Filename on client: <cfoutput>#cffile.clientfile#</cfoutput><br> Filename on server: <cfoutput>#cffile.serverfile#</cfoutput><br> File Size: <cfoutput>#cffile.filesize#</cfoutput><br> <!--- move file to another folder ---> <cffile action="move" source="D:\temp\#cffile.serverfile#" destination="d:\junk\#cffile.serverfile#"> <br> File successfully moved to D:\Junk\<cfoutput>#cffile.serverfile#</cfoutput> Peter Bagnato I am using something relative to the following code: <form action="blahblahblah.cfm" method="post" enctype="multipart/form-data"> <input type="File" name="uploadedFileName"><br> <input type="Submit" value="Upload Now"> </form> During the process, I am attempting to catch the variable "uploadedFileName," but instead of getting a file name like myfilename.zip or whatever, I get something like: R:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\neotmp1 6991.tmp Being that neotmp16991.tmp is not the file name and is really something like myfilename.zip, how do I get that actual file name as opposed to what is seen above. -//- Jaye Morris - Multimedia Developer -//- jaye@navtrak.net - www.navtrak.net -//- jaye@jayezero.com - www.jayezero.com The variable you want to call is actually #File.ServerFile# This is the default name assigned by CF to any just uploaded file. There's also a host of other available attributes. Check the docs for more info. hth, ~Val ----- Excess quoted text cut - see Original Post for more -----
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||