Jump to content

[SOLVED] permissions problem with imagejpeg()


evanct

Recommended Posts

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?

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');
}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.