insrtsnhere13 Posted March 5, 2006 Share Posted March 5, 2006 This is the code im am using[code]<form enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="3000000"> Image:<br><input name="userfile" type="file"><br><input type="submit" name="upload" value="Upload"><?$uploaddir = '/usr/home/pwncae/public_html/gallery/';$uploadfile = $uploaddir . basename($_FILES['userfile']['name']); if(isset($_POST['upload'])){ if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "<br>File is valid, and was successfully uploaded.";$fullurl='http://www.pwncaeks.com/gallery/'.$_FILES['userfile']['name'];$im_file_name = $fullurl;$image_attribs = getimagesize($im_file_name);$im_old = imageCreateFromJpeg($im_file_name);$th_max_width = 144;$th_max_height = 144;$ratio = ($width > $height) ? $th_max_width/$image_attribs[0] : $th_max_height/$image_attribs[1];$th_width = $image_attribs[0] * $ratio;$th_height = $image_attribs[1] * $ratio;$im_new = imagecreatetruecolor($th_width,$th_height);imageAntiAlias($im_new,true);$th_file_name = '/gallery/thumbs/' . $_FILES['image_file']['name'];imageCopyResampled($im_new,$im_old,0,0,0,0,$th_width,$th_height, $image_attribs[0], $image_attribs[1]);imageJpeg($im_new,$im_file_name,100); }}?>[/code]See below for the error Quote Link to comment https://forums.phpfreaks.com/topic/4153-thumbnail-generation-problem/ Share on other sites More sharing options...
insrtsnhere13 Posted March 6, 2006 Author Share Posted March 6, 2006 File is valid, and was successfully uploaded.Warning: imagejpeg(): Unable to open 'http://www.pwncaeks.com/gallery/thumbs/' for writing in /home/pwncae/public_html/dashboard/testgall2.php on line 34sorry about the first post, the errors there arent what was actually going on, used to much bandwidth at once so it cut the image off, anyway, the above error is my problem Quote Link to comment https://forums.phpfreaks.com/topic/4153-thumbnail-generation-problem/#findComment-14622 Share on other sites More sharing options...
insrtsnhere13 Posted March 7, 2006 Author Share Posted March 7, 2006 seriously, can someone please help me with this, i have no clue whats wrong.. Quote Link to comment https://forums.phpfreaks.com/topic/4153-thumbnail-generation-problem/#findComment-14953 Share on other sites More sharing options...
insrtsnhere13 Posted March 7, 2006 Author Share Posted March 7, 2006 omfg.. someone please help me.. im desperate! Quote Link to comment https://forums.phpfreaks.com/topic/4153-thumbnail-generation-problem/#findComment-15057 Share on other sites More sharing options...
AndyB Posted March 7, 2006 Share Posted March 7, 2006 Does the folder ..../gallery/thumbs actually exist? Does it have the correct permissions to allow you to save files to it? Quote Link to comment https://forums.phpfreaks.com/topic/4153-thumbnail-generation-problem/#findComment-15069 Share on other sites More sharing options...
insrtsnhere13 Posted March 7, 2006 Author Share Posted March 7, 2006 yes, there is a thumbs folder in the gallery folder and both are chmod to 0777 Quote Link to comment https://forums.phpfreaks.com/topic/4153-thumbnail-generation-problem/#findComment-15111 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.