Upload Error - Invalid File

Permalink
I am currently setting up a concrete5 installation on a new server, after having it funtion properly on my development server.

Everything appears to have installed properly etc, although when I try to upload a file or image in file manager I always get "Upload Error - Invalid File", no matter the file or type (I have tried to upload the same jpegs I used before).

The environment check during the installation says everything is fine. Here's the environment check with the dashboard:

# concrete5 Version
5.4.0.5
# concrete5 Packages
None
# concrete5 Overrides
None
# Server Software
Apache
# Server API
apache2handler
# PHP Version
5.2.12
# PHP Extensions
apache2handler, bz2, ctype, curl, date, 
dom, exif, filter, ftp, gd, hash,


Any help would be much appreciated.

I have already tried switching on register_long_arrays which did not work.

I am using Concrete5 version 5.4.0.5

 
olsgreen replied on at Permalink Reply
olsgreen
Sounds like a permissions issue, I had that error occuring when PHP didn't have the correct permissions to the temp upload directory.

I'd check the permissions on that folder (needs full control). You can find the directory by running phpinfo() and then finding the valuse stored in the variable upload_tmp_dir.

Oli
metalboxhead replied on at Permalink Reply
Hi Oli,

Thanks for your response. I've checked the upload_tmp_dir and the value is /domains/myurl.com.au/upload_tmp. The permissions were set to 750, and i've tried 755 and even 777 (although I wouldn't leave it there)and still no luck.

In File Manager -> Access my standard file location is /domains/myurl.com.au/web/files. The permission of that directory is set to 755, and I've also tested 777.

My open_base_dir is /domains/myurl.com.au/web/. I've noticed on my development server that my open_base_dir has :/tmp on the end. Does this make a difference?

Any other ideas?
olsgreen replied on at Permalink Reply
olsgreen
Sorry should of clarified permissions, as your in a hosted environment this may be hard to answer, is the user Apache is running under a member of the group that owns the upload_tmp directory?

I'm not in the office at the moment, when I get back later on I'll attach a modified version of C5s upload handler that will give you the exact problem.

O
metalboxhead replied on at Permalink Reply
Hi Oli,
Looking at the owner group of the upload_tmp directory, it's the same as the 'web' directory that the C5 installation is in.

Yes if you have the modified version of the upload handler that would be awesome!
Thanks in advance.
olsgreen replied on at Permalink Reply 1 Attachment
olsgreen
Right, all the attached modded class does is display the name of the tmp file that triggers the 'Invalid File Error'. This will still be a temporary file. (i.e. /usr/tmp_uploaded/php34AD2.tmp)

So, when you try to upload a file from the dashboard you should get the name of the temporary file. You need to find the temp. file shown check it's permissions (Users, Groups, etc) & that it exists. Permissions issues can cause files 'not to exist' even if they do. :S

This error is saying that C5 can't find the file, C5 does a file_exists() check on the path, which in your case is returning false. See this note on the PHP site regarding possible problems (safe_mode, etc):http://php.net/manual/en/function.file-exists.php...

The class I've attached needs to go in: /libraries/file/importer.php (You may need to create the folder.

If this doesn't get you far let me know, however, the cause is probably the simplest thing that is a major pain to find!

Oli
metalboxhead replied on at Permalink Reply
Hi Oli,

Thanks again, I have run importer.php then tried to upload a file, and the error message is now as follows:

Invalid file: /domains/myurl.com.au/upload_tmp/phpS3hS8T

Now when I go to the upload_tmp folder it is empty! As the permissions don't make a difference, I would assume that the owner/group is the problem? As mentioned previously it's the same as the 'web' directory that C5 is stored in. Looking at my dev server most other directories that don't run the website have root owner/group.

So do I need to get my webhost to change the owner/group of the upload_tmp directory?

Or am I better off asking for the upload_tmp_dir to be 'no value' and getting :/tmp put on the end of the open_basedir?
olsgreen replied on at Permalink Reply
olsgreen
Sorry for the delay!

I would get them to correct the user and/or group of the existing directory, they probably won't want you using the systems tmp directory.

KR

O
jwsmith92262 replied on at Permalink Reply
This is a great tool for troubleshooting upload problems! Thanks for the mod importer.php...

Here is the output from the mod running on IIS6...

------------- output below --------------
C:WINDOWSTempphp8F8.tmp
--------------output above --------------

I assume that the appropriate backslashes from the path are being stripped, and that the path should be "C:\WINDOWS\Temp\php8f8.tmp".

Any suggestions on where to start to mod to fix this?