DarkHavn Posted November 5, 2006 Share Posted November 5, 2006 Ok, well i have a file form, for some odd reason it won't move directories from the tmp directory, here is the following code,i will point out the error it spews out after the code[code]$uploadedfile = $_FILES['images1']['tmp_name'];// Create an Image from it so we can do the resize$src = imagecreatefromjpeg($uploadedfile);$src2 = imagecreatefromjpeg($uploadedfile);// Capture the original size of the uploaded imagelist($width,$height)=getimagesize($uploadedfile);// For our purposes, I have resized the image to be// 600 pixels wide, and maintain the original aspect // ratio. This prevents the image from being "stretched"// or "squashed". If you prefer some max width other than// 600, simply change the $newwidth variable$newwidth = 800;$newheight = 600;$newwidth2 = 100;$newheight2 = 100;$tmp=imagecreatetruecolor($newwidth,$newheight);$tmp2 = imagecreatetruecolor($newwidth2, $newheight2);// this line actually does the image resizing, copying from the loriginal// image into the $tmp imageif(imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height)){$imagename = $_FILES['image']['name'];$filename = "C:\\xampp\\xampp\\htdocs\\localfind2\\localfind\\img upload\\imgup\\img\\"; $tmp=imagecreatetruecolor($newwidth,$newheight);$folder = "Clients";//checking to see if the function is working properly due to web drive not supportingimagejpeg($tmp,$filename,100);} else {echo "nay";}[/code]the error is[quote]Warning: imagejpeg() [function.imagejpeg]: Unable to open 'C:\xampp\xampp\htdocs\localfind2\localfind\img upload\imgup\img\' for writing in C:\xampp\xampp\htdocs\localfind2\localfind\img upload\imageup.php on line 68[/quote]tryed everything, the path is correct because i have another feild that deals with pdfs and its moving properly Link to comment https://forums.phpfreaks.com/topic/26223-image-upload-problem-moving-from-tmp-directory/ Share on other sites More sharing options...
Stooney Posted November 5, 2006 Share Posted November 5, 2006 check your folder permissions for C:\xampp\xampp\htdocs\localfind2\localfind\img upload\imgup\img\ as the error states it cannot open it for writing. Link to comment https://forums.phpfreaks.com/topic/26223-image-upload-problem-moving-from-tmp-directory/#findComment-119982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.