Unable to upload images or files

John Barber wrote:
> Have managed to get one image and a few files uploaded but now are unable
> to load images/files to the site.
> The upload wizard appears but then get a code 500 internal server error.
> The image then appears in the list as (incomplete).
> Have looked at the server file folder permissions and given write access
> but this made no difference.

Heh. Let me guess, you're using CF6.x. This is a known bug in Jrun4 Updater 3 (this is what is used in CF6). It is fixed in Jrun4 Updater 4, but unless you're using the full version of Jrun, you're out of luck (there is no known patch for CF6).

Macromedia refuses to fix it for CF6 (because it only seems to effect some people. Personally I believe it has to do with the amount of ram you have available for Jrun. I haven't tried realocating RAM to Jrun because the my client recently upgraded to CF7 and a more powerful server with more RAM).

Known fixes:

  1. Upgrade to CF7
  2. If using a full Jrun server, update to Jrun4 Updater4 (or better).

Workarounds:

  1. Restart CF Service (only works for a little while before you have to restart the service again. Thus this is not a good solution).
  2. (what most people choose to do) Place this code somewhere before the <cffile> tag (I just placed it in Application.cfm. Messy? Yes, but otherwise the server kept giving out the error unless I placed the code in front of "every" <cffile>).
<!--- Start: Check for temp directory --->
<cfif not directoryExists(GetTempdirectory())>
  <cfdirectory action="create" directory="#GetTempdirectory()#">
</cfif>
<!--- End: Check for temp directory --->

-Jeff C.