Expression Engine file upload won't work. Why?
August 31, 2009 4:56 PM   Subscribe

Why won't Expression Engine's file upload work?

My first Expression Engine website has gone smoothly, with the exception of the file upload function within the Edit window. The server path and directory permissions are both correct (I've checked and re-checked). The file browser works fine (which I assume confirms the path is right), but attempted uploads give me the error message "An error of an unknown type was encountered."

EE's support staff haven't been able to provide a solution yet (via my forum thread) and searching through past forums threads shows me others have had this problem, but it's normally the result of server path or permissions issues.

I've begun to think the problem might stem from an issue with the host's temp directory. Apparently, uploaded files initially reside in a temp directory before being copied to the final destination (my "uploads" folder).

One more troubling aspect - the host's control panel file upload works fine.

Any suggestions? I'm baffled and frustrated. I'll attempt phone support with the hosting company tomorrow, but I'm hoping to know more about a possible solution before then.
posted by davebush to Computers & Internet (4 answers total)
 
Best answer: Do you have access to your server logs? (cPanel should have a link to them). These logs may provide more specific information about the failure.

Do all files not upload, or simply large files?
posted by null terminated at 6:03 PM on August 31, 2009


I've had those problems when my files are too large or when the format is not accepted. For example, you can't upload BMP files to a directory that only allows image files (duh). Have you tried uploading small gifs or jpgs? Also, try allowing all file types.
posted by clearlydemon at 6:20 PM on August 31, 2009


Response by poster: null terminated - checking the server logs was a great idea. Thanks. I think this (below) indicates my suspicion about the temp directory issue might be warranted.

[Mon Aug 31 19:43:39 2009] [error] [client 216.121.164.123] PHP Warning: Unknown: open_basedir restriction in effect. File(/var/tmp/) is not within the allowed path(s): (/web/xxxx.on.ca/httpdocs:/web/xxxx.on.ca/httpsdocs:/tmp) in Unknown on line 0, referer: http://www.xxxx.on.ca/system/index.php?S=ffeb6856d5ff29a64f47f39039437e114abe22bc&C=publish&M=file_upload_form&field_group=3&Z=1

[Mon Aug 31 19:43:39 2009] [error] [client 216.121.164.123] PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0, referer: http://www.xxxx.on.ca/system/index.php?S=ffeb6856d5ff29a64f47f39039437e114abe22bc&C=publish&M=file_upload_form&field_group=3&Z=1
posted by davebush at 6:58 PM on August 31, 2009


Well, there you go - your PHP instance doesn't have permission to access /var/tmp.

I'm not familiar with Expression Engine particularly (I played with it once ages ago, but that's it) but presumably the temp directory for uploads can be configured somewhere, either through the admin or by editing the config files. It's probably set to /var/tmp by default; changing it to /tmp (which, according to the first error you list above is in the allowed paths) should make it work.
posted by Pinback at 8:04 PM on August 31, 2009


« Older Real-time Equities Pricing   |   Help me want to get up in the AM Newer »
This thread is closed to new comments.