pajoo Posted February 2, 2012 Share Posted February 2, 2012 Hey, when a user want to upload a image this error comes up: Warning: imagejpeg() [function.imagejpeg]: Unable to open 'upload/thumbs/Forest Flowers.jpg' for writing: Permission denied in /home/oppasser/domains/oppassergezocht.nl/public_html/mijn-account.php on line 195 Warning: fopen(upload/thumbs/Forest Flowers.jpg) [function.fopen]: failed to open stream: No such file or directory in /home/oppasser/domains/oppassergezocht.nl/public_html/mijn-account.php on line 197 Warning: filesize() [function.filesize]: stat failed for upload/thumbs/Forest Flowers.jpg in /home/mijn-account.php on line 198 Warning: fread(): supplied argument is not a valid stream resource in /home/mijn-account.php on line 198 Warning: fclose(): supplied argument is not a valid stream resource in /home/mijn-account.php on line 200 Warning: unlink(upload/thumbs/Forest Flowers.jpg) [function.unlink]: No such file or directory in /home/mijn-account.php on line 201 imagejpeg($dimg, "$tdir" . $url); // Saving The Image $tmpName = "$tdir" . $url; $fp = fopen($tmpName, 'r'); $updimgcontent = fread($fp, filesize($tmpName)); $updimgcontent = addslashes($updimgcontent); fclose($fp); unlink($tmpName); imagedestroy($simg); // Destroying The Temporary Image imagedestroy($dimg); // Destroying The Other Temporary Image Help? Quote Link to comment https://forums.phpfreaks.com/topic/256255-image-uploading-error/ Share on other sites More sharing options...
thewebsolutionprovider Posted February 2, 2012 Share Posted February 2, 2012 This looks like folder permissons. Make sure the folder your uploading to has write permissions for the script owner. You can even use the php function chmod() http://php.net/manual/en/function.chmod.php to change the folder perms in your code before moving the file. Quote Link to comment https://forums.phpfreaks.com/topic/256255-image-uploading-error/#findComment-1313666 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.