Mutley Posted April 29, 2009 Share Posted April 29, 2009 Warning: copy(corries_dev/images/gallery/Autumn Leaves.jpg) [function.copy]: failed to open stream: No such file or directory in /home/corrieso/public_html/corries_dev/admin.php on line 76 Code.... (Lines 65 to 79, ex tags) <?php $idir = "corries_dev/images/gallery/"; // Path To Images Directory $tdir = "corries_dev/images/gallery/thumbs/"; // Path To Thumbnails Directory $twidth = "150"; // Maximum Width For Thumbnail Images $theight = "150"; // Maximum Height For Thumbnail Images $lwidth = "600"; // Maximum Width For Thumbnail Images $lheight = "480"; // Maximum Height For Thumbnail Images $type = $_FILES['imagefile']['type']; if($type == "image/jpg" || $type == "image/jpeg" || $type == "image/pjpeg"){ $file_ext = strrchr($_FILES['imagefile']['name'], '.'); // Get The File Extention In The Format Of , For Instance, .jpg, .png or .php $rand = rand(1,99999); $copy = copy($_FILES['imagefile']['tmp_name'], "$idir" . $_FILES['imagefile']['name']); // Move Image From Temporary Location To Permanent Location $url = $_FILES['imagefile']['name']; // Set $url To Equal The Filename For Later Use if($copy){ // If The Script Was Able To Copy The Image To It's Permanent Location ?> Done CHMOD 777, script works fine on another site, the directory IS there. Quote Link to comment https://forums.phpfreaks.com/topic/156153-copy-function-error-directory-not-found/ Share on other sites More sharing options...
ignace Posted April 29, 2009 Share Posted April 29, 2009 you shouldn't use copy to move uploaded files from the temporary folder use move_uploaded_file() instead: http://be2.php.net/move_uploaded_file Quote Link to comment https://forums.phpfreaks.com/topic/156153-copy-function-error-directory-not-found/#findComment-822035 Share on other sites More sharing options...
Mutley Posted April 29, 2009 Author Share Posted April 29, 2009 Thanks but still problems: Warning: move_uploaded_file(images/gallery/Tree.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/corrieso/public_html/corries_dev/admin.php on line 76 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpk2kq6Q' to 'images/gallery/Tree.jpg' in /home/corrieso/public_html/corries_dev/admin.php on line 76 Quote Link to comment https://forums.phpfreaks.com/topic/156153-copy-function-error-directory-not-found/#findComment-822042 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.