Skip to main content
March 25, 2011
Question

cffileupload not actually uploading

  • March 25, 2011
  • 2 replies
  • 1870 views

OK, I've scoured the web looking for someone who has seen this problem and no luck.

I am trying to do a cffileupload to give users the ability to easily upload multiple files.  The flash interface comes up... I browse to 1 file, click the upload button and the progress bar moves until it shows it uploaded 1 file.  The problem is I can't find the file anywhere especially in the directory I specifed.  I've searched the entire server, I've looked for temp files that need to be renamed and moved, I've looked in the log files... nothing.

    <cffileupload
    url="process.cfm?pro_num=#pro_num#"
    progressbar= "true"
    title="Upload Closeout Pictures"
    wmode="transparent" />

process.cfm

   <cfset path = #file_path# & "\" & #url.pro_num# >

   <cffile
   action="upload"
   destination="#path#"
   nameconflict="overwrite" /

Any help would save the last of my hair!

Thanks.


Robin

    This topic has been closed for replies.

    2 replies

    talofer99
    Inspiring
    March 26, 2011

    I had hard time with this as well while trying to ad it to a shopping cart admin section.

    The problem was that the SESSION gets lost and if u don't pass the urltoken,  the cf don’t see the login and fail the process (this was on my app).

    I don’t know what you are using it for, but if its on a HAVE TO BE LOGEDIN first page, this is where you bug is.

    So try adding this : url="youruplaodfile.cfm?#urlEncodedFormat(session.urltoken)#"

    To your code and see if it works

    One more thing on your SAVE page, add this to make sure your directory exists before u save the file into it :

    <!--- check if dosnt exists, cretae --->

    <cfif Not DirectoryExists(_ProductFolderPath)>

                <cfdirectory action = "create" directory = "#_ProductFolderPath#" >

    </cfif>

    Inspiring
    March 25, 2011

    The action attribute value on your CFFILE tag should be changed to "uploadall" in order to support multiple files.  If this does not help please post  more complete code samples.

    March 25, 2011

    I had the action set to uploadall previously but tried it again just to be safe.  Same result - it shows a successful upload but no file exists.  I don't have anymore code to post - literally that is all there is.

    Thanks.

    Inspiring
    March 25, 2011

    What do your web server logs record? Is anything being uploaded (and possibly failing)? Does your web server have any security options, such as URLScan (for Windows IIS) that might be preventing file uploads?