ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   Anyone got a cold fusion file uploader? (https://www.scoobynet.com/computer-and-technology-related-34/178761-anyone-got-a-cold-fusion-file-uploader.html)

DazV 17 February 2003 10:35 PM

Needs something that will browse users machine and permit the upload of a JPEG

Thanks in advance,
-DV


SJ_Skyline 18 February 2003 09:02 AM

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 :)

DazV 18 February 2003 11:52 AM

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

SJ_Skyline 19 February 2003 08:50 AM

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 :)

DazV 19 February 2003 02:25 PM

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

stevem2k 19 February 2003 02:57 PM

Daz ... YHM


Steve

DazV 19 February 2003 03:17 PM

Cheers


All times are GMT +1. The time now is 10:57 PM.


© 2024 MH Sub I, LLC dba Internet Brands