Copy link to clipboard
Copied
I am trying to get info for my uploaded variable. Live docs tells me that source can be
source = "absolute pathname|pathname relative to the web
root|URL|#cfimage variable#"
How do I set
my uploaded file to a #cfimage variable#?
Below is what I have but does not work.
<cffile action="upload" nameconflict="overwrite" destination="#ExpandPath("./images")#"
filefield="FORM.uploadImage" result="myFile" />
<cfimage action = "info" source = "#myFile#" structname = "myFile3"
Copy link to clipboard
Copied
The result #myFile# is a structure of information about the uploaded file, not a string. You need to use some of the values in that structure. Read the documentation on cffile for a list of the structure contents.
http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_f_10.html#3540091
Copy link to clipboard
Copied
Not helped me still struggling to create a cfimage variable that points to the file.
Thanks
Copy link to clipboard
Copied
The following file upload status parameters are available after an upload:
resultName.serverDirectory - Directory of the file saved on the server
resultName.serverFile - Filename of the file saved on the server
ie
#myFile.serverDirectory#
#myFile.serverFile#
You use those values to construct the file path for cfimage
Copy link to clipboard
Copied
Hulfy, did you get this working? What (I think) cfsearching is saying (and from what I understand you need to do) simply name your variable to the upload parameter as such:
<cffile destination="#ExpandPath("./images")#" action="upload" nameconflict="overwrite" filefield="#uploadimage#">
<cfset myFile3 = "#myFile.serverFile#">
[ perform any actions such as resizing etc ]
<img src="images/#myFile3#">