Results 1 to 4 of 4
-
01-09-2010, 02:58 PM #1
Coldfusion - Saving the File Name for Image Uploader Applet
I have recently purchased a Java Image Uploader from java upload applet - MyUploader does anyone have any coding that will allow me to save the image name in a MySQL db during or after a sucessful upload.
Any help would be great.
-
02-02-2010, 11:39 AM #2
Just fyi, that sample is not a good example of well written CF code. I am not even sure it works. You would be better off using the livedocs example
http://livedocs.adobe.com/coldfusion...0.html#3540091
... or one of these guides.
http://www.coldfusionjedi.com/index....e-Upload-Guide
http://www.coldfusionjedi.com/index....Security-Issue
But, to answer your question about that specific example, you use <cffile..> to do the upload. CF then populates a structure named #CFFILE# (or the "result" attribute) with details like the fileName, extension, the directory it was saved to etctera. You can view all of file properties, by dumping the #CFFILE# structure just after your upload:
<cffile action="upload" ...>
<cfdump var="#CFFILE#">
You then use the #CFFILE# structure in combination with <cfquery ..> to extract and store the filename in your database.
<cfquery ...>
INSERT INTO SomeTable (SavedFileName)
VALUES ( <cfqueryparam value="#CFFILE.serverFile#" cfsqltype="cf_sql_varchar"> )
</cfquery>
Out of curiosity, why do you need a separate image uploader? ie What does it do that you cannot do with a regular form?
-
03-12-2010, 07:09 AM #3
Freshman
- Join Date
- Mar 2010
- Posts
- 13
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Thanks your prompt reply, I am relatively new to CF and have only been developing for the last year. I basically am looking to create a cfform that allows a user to upload up to 5 images, restricts file uploads to 2gb and stores the filename in the database, once uploaded the form action redirects the user to to a another page.
Any example coding instead of using Java to Work would be greatly apprecieted.
-
12-17-2010, 05:48 AM #4
Freshman
- Join Date
- Dec 2010
- Posts
- 43
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
The Java image uploader from java upload applet MyUploader does anyone have any coding that will allow me to save the image name in a MySQL db during or after a sucessful upload.Thanks for sharing information.
Similar Threads
-
PR6-PR2 Dofollow Blog commenting. Tons of packages and price ranges. Check it out.
By backlinkgurus in forum LinksReplies: 6Last Post: 06-08-2012, 06:18 AM -
newbie questions on generating Word document from ColdFusion
By Abina in forum ColdFusionReplies: 1Last Post: 02-02-2010, 11:35 AM -
What is coldfusion?
By wujijiangjun in forum ColdFusionReplies: 8Last Post: 01-05-2010, 09:59 AM -
How to find a pdf file is normal file or shared review file
By sunshine in forum JavaScript & AJAXReplies: 0Last Post: 01-04-2010, 11:21 AM -
138 Commands of Commond Prompt
By mrfriend27 in forum Web Development - Programming & CodingReplies: 9Last Post: 07-08-2008, 09:19 PM





Reply With Quote

