Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cffileupload not actually uploading

Guest
Mar 25, 2011 Mar 25, 2011

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

1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 25, 2011 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 25, 2011 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 25, 2011 Mar 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 25, 2011 Mar 25, 2011
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 25, 2011 Mar 25, 2011

I can never get anything to show on the process.cfm page.  I put output tags and they never run so I put the cfdump tag and nothing happens - it stays on the flash file upload wizard.

Robin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 25, 2011 Mar 25, 2011

The file upload does not occur via traditional form posts for CFFILEUPLOAD. Rather than use CFDUMP try CFLOG to dump the result of the cffile somewhere where it can be examined.

If your process.cfm is never used (there should be a POST to this page in your web logs), then it probably means the files are not being sent to the server. I would verify that any scripts/flash files required by CFFILEUPLOAD are in place and accessible to the browser.

You might also try the sample code from the documentation that uses JavaScript to give the browser feedback about the upload process.

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7a01.html#WSe9cbe5cf462523a0fe521c212308a43ca3-7ffe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 25, 2011 Mar 25, 2011

The javascript example never fires just like all the other functions/tags I put into process.cfm after the cffile tag.  I tried logging using cflog and it does report an error but doesn't say what the error is - just error.  Is there a variable I should use that would contain the error message?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 25, 2011 Mar 25, 2011

If the JavaScript doesn't "fire" I suspect that process.cfm page is either failing or not being called at all.

Things to check:

1. The contents of the cffile result variable.

2. Put a try/catch around the cffile and see any exceptions are thrown. Examine the exception error message for any information.

3. Have you posted all of your code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 25, 2011 Mar 25, 2011

It shouldn't be this hard.  Thanks for the help but this is wasting too much time... I'm moving on.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 25, 2011 Mar 25, 2011
LATEST

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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources