Welcome Guest, Not a member yet? Register   Sign In
Can't modify files uploaded with the File Uploading Class
#1

[eluser]little brittle[/eluser]
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.
#2

[eluser]mihailt[/eluser]
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.
#3

[eluser]little brittle[/eluser]
[quote author="mihailt" date="1227278296"]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.[/quote]
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?
#4

[eluser]mihailt[/eluser]
well ok then, probably not the only solution but try http://www.php.net/manual/en/function.chmod.php Wink
#5

[eluser]little brittle[/eluser]
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?




Theme © iAndrew 2016 - Forum software by © MyBB