選択した画像ファイルを1つのフォルダに別のフォルダにコピーしたいと思います。画像選択プロセスは動的に行われます。私はコピープロセスの下にPHPコードを使用しています。選択した画像の数がある場合:上記のコードは、それがあれば、選択した画像数1ストリームを開けませんでした:そのようなファイルやディレクトリはありません
Error is :
Warning: fopen(uploads/members/album/72/full_e5829jellyfish.jpg) [function.fopen]: failed to open stream: No such file or directory in D:\wamp\www\myprint\photoprint_step2.php on line 51
Could not contact full_e5829jellyfish.jpg
注上記のエラーを生成1.but選択した画像の数がある場合のために完璧に実行され
//$cnt is count of selected images
for($i=0;$i<$cnt;$i++)
{
$img = $sel['album_images']; //name of file to be copied
//read the file
$fp = fopen('uploads/members/album/'.$_SESSION['ses_userid'].'/'.$img, 'r') or die("Could not contact $img");
$page_contents = "";
while ($new_text = fread($fp, 100))
{
$page_contents .= $new_text;
}
chdir("uploads/products/design/"); //This moves you from the current directory user to the images directory in the new user's directory
$newfile = "product-".strtotime('now').".png"; //name of your new file
//create new file and write what you read from old file into it
$fd = fopen($newfile, 'w');
fwrite($fd, $page_contents);
fclose ($fd);
}
2番目の画像が正常にコピーされ、次に(2番目の画像)エラーが生成されます。何が起こった?
のように可能性のある重複し、それにいくつかのランダムな定数を配置しようとすると[PHPは - ストリームをオープンに失敗しましたありません:そのようなファイルやディレクトリいいえ] http://stackoverflow.com/questions/36577020(/php-open-stream-no-such-file-or-directory) –