Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Anyone got a cold fusion file uploader?

Thread Tools
 
Search this Thread
 
Old 17 February 2003, 10:35 PM
  #1  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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

Thanks in advance,
-DV

Old 18 February 2003, 09:02 AM
  #2  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
Smile

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
Old 18 February 2003, 11:52 AM
  #3  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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
Old 19 February 2003, 08:50 AM
  #4  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
Cool

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
Old 19 February 2003, 02:25 PM
  #5  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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
Old 19 February 2003, 02:57 PM
  #6  
stevem2k
Scooby Regular
 
stevem2k's Avatar
 
Join Date: Sep 2001
Location: Kingston ( Surrey, not Jamaica )
Posts: 4,670
Likes: 0
Received 0 Likes on 0 Posts
Post

Daz ... YHM


Steve
Old 19 February 2003, 03:17 PM
  #7  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

Cheers
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
FuZzBoM
Wheels, Tyres & Brakes
16
04 October 2015 09:49 PM
Ganz1983
Subaru
5
02 October 2015 09:22 AM
shorty87
Wheels And Tyres For Sale
0
29 September 2015 02:18 PM
shorty87
Other Marques
0
25 September 2015 08:52 PM
Littleted
Computer & Technology Related
0
25 September 2015 08:44 AM



Quick Reply: Anyone got a cold fusion file uploader?



All times are GMT +1. The time now is 02:29 AM.