Anyone got a cold fusion file uploader?
#2
Part 1 - your form that allows users to browse files:
<form action="filename.cfm" method="post" enctype="multipart/form-data" name="uploadImage" id="uploadImage">
<input type="file" name="imageFileName" id="imageFileName">
<input type="submit" name="submit" id="submit" value="Upload">
</form>
Part 2 - filename.cfm which processes the form: (remember to specify your destination path in application.cfm)
<cffile action="UPLOAD" filefield="imageFileName" destination="#application.imagePath#" nameconflict="MAKEUNIQUE">
Rich
<form action="filename.cfm" method="post" enctype="multipart/form-data" name="uploadImage" id="uploadImage">
<input type="file" name="imageFileName" id="imageFileName">
<input type="submit" name="submit" id="submit" value="Upload">
</form>
Part 2 - filename.cfm which processes the form: (remember to specify your destination path in application.cfm)
<cffile action="UPLOAD" filefield="imageFileName" destination="#application.imagePath#" nameconflict="MAKEUNIQUE">
Rich
#3
Cheers Rich.
That will get me going.
May need to introduce limitations on image size, but I doubt CF offers that kind of functionality. May have to look at some Java.
-DV
That will get me going.
May need to introduce limitations on image size, but I doubt CF offers that kind of functionality. May have to look at some Java.
-DV
#4
this is lifted from some old code - can't remember if cf_filesize is a custom tag or not though - worth a shot!
<cfif right(cffile.serverfile,3) eq "gif" or right(cffile.serverfile,3) eq "jpg">
<cf_imagesize file="#application.imagePath#\#cffile.serverfile#" >
<cfif height gt 150>
<cfset error = "The image height is too large">
<cfelseif width gt 600>
<cfset error = "The image width is too large">
</cfif>
<cfelse>
<cfset error = "The file is not in an acceptable format">
</cfif>
Rich
<cfif right(cffile.serverfile,3) eq "gif" or right(cffile.serverfile,3) eq "jpg">
<cf_imagesize file="#application.imagePath#\#cffile.serverfile#" >
<cfif height gt 150>
<cfset error = "The image height is too large">
<cfelseif width gt 600>
<cfset error = "The image width is too large">
</cfif>
<cfelse>
<cfset error = "The file is not in an acceptable format">
</cfif>
Rich
#5
Ah Rich you tease! Thats the exact kind of code I'm looking for, but that DOES look like a custom tag. CF only offer 3 tags for file management and that ain't one of them!
Any idea where I could get that tag from ?
-DV
Any idea where I could get that tag from ?
-DV
Thread
Thread Starter
Forum
Replies
Last Post
shorty87
Wheels And Tyres For Sale
0
29 September 2015 02:18 PM