evanct Posted July 1, 2009 Share Posted July 1, 2009 I have this function that creates thumbnails from uploaded images. It works fine until it hits imagejpeg(): "Warning: imagejpeg() [function.imagejpeg]: Unable to open '../users/evanct/57fc1272653226e790ae7e2e78705e3d/thumbnail' for writing: Permission denied in C:\Apache2\htdocs\fileservice\core\upload.php on line 32" which is odd because I checked the permissions of the thumbnail directory and it's 0777, just as it should be. i even set its parents to 0777 to be sure, but i'm still getting the error. anyone know what the problem might be? Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/ Share on other sites More sharing options...
evanct Posted July 1, 2009 Author Share Posted July 1, 2009 also happening with move_uploaded_file and the parent dir (../users/evanct/57fc1272653226e790ae7e2e78705e3d). this is frustrating. Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-866954 Share on other sites More sharing options...
evanct Posted July 1, 2009 Author Share Posted July 1, 2009 bump Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-867280 Share on other sites More sharing options...
flyhoney Posted July 1, 2009 Share Posted July 1, 2009 I'm confused, the error you receive provides a Windows file path, but you say the permissions are 0777, which are unix file permissions. Are you on a *nix or Windows machine? Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-867283 Share on other sites More sharing options...
evanct Posted July 1, 2009 Author Share Posted July 1, 2009 Well, by 0777 I just meant that full permissions were enabled for all users. Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-867306 Share on other sites More sharing options...
flyhoney Posted July 1, 2009 Share Posted July 1, 2009 Perhaps you should check to make sure your file path is correct. You can do that using the file_exists method. <?php if (file_exists('../users/evanct/57fc1272653226e790ae7e2e78705e3d/thumbnail')) { die('yay'); } else { die('epic fail'); } Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-867312 Share on other sites More sharing options...
evanct Posted July 1, 2009 Author Share Posted July 1, 2009 Actually earlier in the code I already had a check to see if the directory exists, and if not, create it. it's definitely there. Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-867372 Share on other sites More sharing options...
evanct Posted July 1, 2009 Author Share Posted July 1, 2009 Oh that was careless of me. I had simply forgotten that you need to add to the path the filename you want the file saved as. Link to comment https://forums.phpfreaks.com/topic/164344-solved-permissions-problem-with-imagejpeg/#findComment-867399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.