Part of the EllisLab Network
   
 
Can’t modify files uploaded with the File Uploading Class
Posted: 21 November 2008 01: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 03: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 10:15 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  31
Joined  05-30-2008
mihailt - 21 November 2008 03: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 03: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 06: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
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120606 Total Logged-in Users: 50
Total Topics: 126643 Total Anonymous Users: 2
Total Replies: 665721 Total Guests: 487
Total Posts: 792364    
Members ( View Memberlist )