Skip to main content
Hedge
Inspiring
January 11, 2010
Answered

cffileupload not actually uploading anything

  • January 11, 2010
  • 2 replies
  • 5860 views

I am using a simple example trying to start experimenting with the multiple file upload feature in CF 9. However it acts like it uploads, gives no sort of error I can see, yet it actually uploads nothing to the server. Am i missing something obvious?

Uploading page code.

  <cffileupload
    align="center"
    url="uploadFiles.cfm"
    width=600/>

Code for the uploadFiles.cfm page.

<cffile action="upload" destination="c:\temp" nameconflict="makeunique" />

Pretty simple code yet it doesn't seem to work. I know I can use cffile to write to the directory as I have tested that seperately. Any ideas out there?

This topic has been closed for replies.
Correct answer Adam Cameron.

Yeah neither of those had any information pertaining to it


Is there any chance an Application.cfm / .cfc is doing [something] that is getting in the road here?  Can you remove all doubt by sticking a blank Application.cfm in the same dir as your test code?

I'm pretty much out of sensible things to suggest, so looking at some less sensible ones.

What version of Flash Player are you running?  Have you tested this on various different browsers, in case your FP install is bung on the one you're testing with?

--

Adam

Message was edited by: A Cameron

2 replies

Inspiring
January 12, 2010

Your code works OK for me.  This is little help other than to confirm what you're doing should work.

When you say it seems to work, you get the green progress indicators... err... progressing... as the uploads seem to take place?  And you end up with "uploaded n of n file(s)" in the mauin progress bar at the end?

Have you checked the CF & JRun logs to see if they're logging anything?

Possibly write to file a dump of the CFFILE variable in the action page, and have a look if there's anything untoward there?  Is the action-page URL definitely being called once per file uploaded?  Stick a <cflog> entry at the top of it to check (or similar).

--
Adam

Hedge
HedgeAuthor
Inspiring
January 12, 2010

Yes it shows the upload of each file and tells me it is done. I even have an oncomplete script that spits out the file name to the console aft

er each one is uploaded and that gets fired off too. I tried doing a CFDUMP to a file but that doesn't get written either. I

'll try some more of your suggestions though and get back to you. Thanks for the ideas.


Inspiring
January 12, 2010

Humour me.

Swap the <cffileupload> out for a normal form with a <input type="file"> and try to write that to C:\temp...

--

Adam

BKBK
Community Expert
Community Expert
January 11, 2010

action="uploadAll"

Hedge
HedgeAuthor
Inspiring
January 12, 2010

That doesn't make any difference

From everything I have read cffileupload sends each file individually to the url property indicated. So choosing uploadAll or upload doesn't make a difference. uploadAll is for use when your just posting to a cffile from a normal html form with multiple type="file" fields.

BKBK
Community Expert
Community Expert
January 12, 2010

You must be doing something wrong. You should also note that cffileupload and <cffile action="uploadAll"> were actually designed to work together to make multiple uploading easier.

I copied your code exactly -- and it works! My file structure is

/uploadTest/uploadAllFiles.cfm

<cffileupload
     align="center"
     url="processUpload.cfm"
     width=600/>

/uploadTest/processUpload.cfm

<cffile action="uploadAll" destination="c:\temp" nameconflict="makeunique" />