Jump to content

Image uploading error


pajoo

Recommended Posts

 

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?

 

Link to comment
https://forums.phpfreaks.com/topic/256255-image-uploading-error/
Share on other sites

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.

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.