Results 1 to 4 of 4
  1. #1
    Abina's Avatar
    Abina is offline Master
    Join Date
    Dec 2009
    Location
    United States
    Posts
    1,073
    Thanks
    1
    Thanked 6 Times in 4 Posts
    Feedback Score
    0

    Default 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.

  2. #2
    numberone's Avatar
    numberone is offline Senior
    Join Date
    Jan 2010
    Posts
    623
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    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?

  3. #3
    rockseo is offline Freshman
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    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.

  4. #4
    samson77 is offline Freshman
    Join Date
    Dec 2010
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    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

  1. Replies: 6
    Last Post: 06-08-2012, 06:18 AM
  2. Replies: 1
    Last Post: 02-02-2010, 11:35 AM
  3. What is coldfusion?
    By wujijiangjun in forum ColdFusion
    Replies: 8
    Last Post: 01-05-2010, 09:59 AM
  4. How to find a pdf file is normal file or shared review file
    By sunshine in forum JavaScript & AJAX
    Replies: 0
    Last Post: 01-04-2010, 11:21 AM
  5. 138 Commands of Commond Prompt
    By mrfriend27 in forum Web Development - Programming & Coding
    Replies: 9
    Last Post: 07-08-2008, 09:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS