Part of the EllisLab Network
   
 
Can’t modify files uploaded with the File Uploading Class
Posted: 21 November 2008 02:58 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  31
Joined  05-30-2008

I can successfully upload images via form using the file uploading class. However, the uploaded files are owned by ‘apache’ with chmod 644, so I cannot use the image manipulation class on them. I have tried running chown() on the file after upload, but I get this error: “Operation not permitted”. If I try to run an image resize on it, I get this error: “Your server does not support the GD function required to process this type of image.” The resizing script I’m using is correct and has been tested on existing images owned by ‘ftp’.

How can I use the file uploading class and modify files it creates via PHP? Is there a way to change ownership either during or after creation? I am on a Media Temple server, so there shouldn’t be any crazy limitations I can’t overcome.

Profile
 
 
Posted: 21 November 2008 04:38 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  61
Joined  10-22-2007

view your php settings by calling phpinfo() , search it for “GD”,  most likely you will not found it, and if so - contact your server administrators, so they would add GD for php.

 Signature 

CLE - Controller Loader Extension

Profile
 
 
Posted: 21 November 2008 11:15 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  31
Joined  05-30-2008
mihailt - 21 November 2008 09:38 AM

view your php settings by calling phpinfo() , search it for “GD”,  most likely you will not found it, and if so - contact your server administrators, so they would add GD for php.

GD is there. Like I said, I use the same exact image resize script in another controller and it works perfectly. The problem is that I cannot modify user uploaded files. Is there any way to change permissions/users on uploaded files?

Profile
 
 
Posted: 22 November 2008 04:53 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  61
Joined  10-22-2007

well ok then, probably not the only solution but try http://www.php.net/manual/en/function.chmod.php wink

 Signature 

CLE - Controller Loader Extension

Profile
 
 
Posted: 22 November 2008 07:04 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  31
Joined  05-30-2008

I’ve tried chmod, chown, chgrp, and all of them return permission errors. I just edited my php.ini file to turn off safe_mode, and I still have the same problems. Is there really no way for me to resize an uploaded image?

Profile