Expand|Select|Wrap|Line Numbers
- Warning: imagejpeg() [function.imagejpeg]: Unable to open '../uploads/thumb/' for writing: Is a directory in /home/.gobbles/mahcuz/mahcuz.com/upload/uploaded.php on line 129
Expand|Select|Wrap|Line Numbers
- /* New code for thumbnails. Will on work if user selects "create thumb on upload" on the upload page */
- //check to see if checkbox is selected
- if(isset($_POST['thumbBox'])){
- // Load image and get image size
- $img1 = "../uploads/mahcuz_".$uploadedImg;
- $orgimg = imagecreatefromjpeg($img1);
- $width = imagesx($orgimg);
- $height = imagesy($orgimg);
- // Setting new width and height for thumbnail size
- $newwidth = 100; //any size as you wish
- $newheight = floor($height*($newwidth/$width));
- // Creating new temporary image
- $tmpimg = imagecreatetruecolor($newwidth, $newheight);
- // Copy and resize old image into new image
- imagecopyresized($tmpimg, $orgimg, 0, 0, 0, 0, $newwidth, $newheight, $width, $height );
- // Save thumbnail into a file
- $path = "../uploads/thumb/"; // <<<< this is line 129 !
- imagejpeg($tmpimg, $path.$img) or die("error");
- $thumbAlert = "Thumbnail created succesfully. Please use the code provided (on the right) to link to the
- thumbnail of your uploaded image";
- }
- /* end code for thumbnails */
Not sure what the problem might be. It says unable to write, could it be the file permissions? I've got it set to 777
Thanks :)