Jump to content

Copy function error (directory not found?)


Mutley

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/156153-copy-function-error-directory-not-found/
Share on other sites

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

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.