Skip to main content
Participant
October 20, 2009
Question

Troubleshooting CFFILE

  • October 20, 2009
  • 2 replies
  • 775 views

I have several pages that allow users to upload files that have started giving me problems since migrating to CF 8 (installed CF 8 fresh on a new 2003 server running IIS and migrated files and settings manually.)

Here's the code for the page (This is essentially straight from LiveDOCs):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Upload File with ColdFusion</title>
</head>
<body>
<cfif isdefined("form.upload_now")>
<cffile action="upload" filefield="ul_path" destination="D:\uploaded\" accept="*" nameconflict="makeunique">
The file was successfully uploaded!
</cfif>

<form action="upTest.cfm" method="post" name="upload_form" enctype="multipart/form-data" id="upload_form">
<input type="file" name="ul_path" id="ul_path">
<input type="submit" name="upload_now" value="submit">
</form>
</body>
</html>

I can upload a few files but then it stops working. The rest of the site works fine. There's no error message and nothing in any of the logs. IE simply displays an empty page.

Here's the page source from when it doesn't work:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    October 25, 2009

    My guess is that the problem is caused by the value accept="*". There may be something lost in the translation  of the wildcard MIME from Coldfusion to the browser. In my upload code, I always spell out all the acceptable MIME types, as in,

    accept = "image/jpeg,image/pjpeg,image/jpg,image/png,image/gif,application/msword,application/vnd.ms-excel,application/pdf,application/octet-stream"

    Inspiring
    October 22, 2009

    I know you said there was nothing in the logs, but did you check the JRun logs as well as the CF ones?  What about the webserver logs?

    Can you stick some <cflog> tags at the beginning & end of the file, as well as either side of the <cffile> and see whether CF is running the template at all, or at what point it stops?  Although it looks like it's not even getting to that template at all, given what it's returning.

    Where's that "blank" HTML coming from?  It's got nothing to do with that template you list.  It's got to be coming from somewhere...?

    Have you looked @ the HTTP traffic going on when you're uploading files to see if anything weird starts happening there?

    CFFILE uploads only transfer the uploaded file from... ooh, can't remember... either the CF temp dir or some equivalent on the web server.  Are the files at least arriving on the server, and it's simply the <cffile> that ain't working?

    If you do a CF restart, does it come right?

    --

    Adam