Mike Waller
asked on
parse out image and extension using railo (coldfusion)
I'm using type="file" in the form, but when i submit the form, the page that follows I get this..
/var/www/domain/public_htm l/WEB-INF/ railo/temp /tmp-20
using..
<cfset thisimage = listfirst(#form.imagefile# ,".")>
<cfoutput>#thisimage#</cfo utput>
how would I parse out the name of the file and its extension?
/var/www/domain/public_htm
using..
<cfset thisimage = listfirst(#form.imagefile#
<cfoutput>#thisimage#</cfo
how would I parse out the name of the file and its extension?
To clarify the last comment. First upload.
<cffile action="upload" filefield="form.imagefile" .....>
Then use the cffile variables:
#CFFILE.serverFileExt#
Extension of the uploaded file on the server (without a period)
#CFFILE.serverFileName#
Name of the uploaded file on the server (without an extension)
<cffile action="upload" filefield="form.imagefile"
Then use the cffile variables:
#CFFILE.serverFileExt#
Extension of the uploaded file on the server (without a period)
#CFFILE.serverFileName#
Name of the uploaded file on the server (without an extension)
You can use
#cffile.serverfile#
you will get complete file name along with its extension.
#cffile.serverfile#
you will get complete file name along with its extension.
They want the name and extension separated. Fortunately, cffile has variables for that too ;-) See my previous post.
Hi, if you want the original file name (name of the file, as you select before uploading), you can use
#cffile.clientfile# ==> complete file name with extension
#cffile.clientfileName# ==> File name (as it was in your system before uploading) without extension
#cffile.clientfileExt# ==> file extension
#cffile.clientfile# ==> complete file name with extension
#cffile.clientfileName# ==> File name (as it was in your system before uploading) without extension
#cffile.clientfileExt# ==> file extension
ASKER
ok, I'll try out your suggestions.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
You then have to use cffile "upload" to get access to the real file name (and move it to desired directory). Use CFFILE variables like #CFFILE.serverFile#, #CFFILE.serverDirectory# to access the file name and extension ...
ie <cffile action="upload" filefield="form.imagefile"
<cfdump var="#CFFILE#">