i try to copy images file from deep folder to public_html root folder..
but it cant work
these show
Warning: copy(public_html/050314-23/schoolgirl-004.jpg): failed to open stream: No such file or directory in /home/booster/public_html/mir5/thumbnail.php on line 154
in case of copy() fuction.
these show
Warning: rename(saved/schoolgirl-002.jpg,public_html/050314-26/schoolgirl-002.jpg): No such file or directory in /home/booster/public_html/mir5/thumbnail.php on line 154
in case of rename() fuction.
i dont know why cant do it. about chmod ?
just chmod777 all file after i put it to src dir ?
ps. source dir : public_html/mir5/saved/
dest dir : public_html/<i make random generate dir name with chmod755>
and this a copy / rename code i used ..
PHP Code:
if($mover){
$dir_to_open="saved";
$base="saved/";
$dir=@opendir($dir_to_open);
$savedir=@date("ymd-i");
$savedir2="public_html/$savedir";
$i=0;
FtpMkdir('public_html/','$savedir');
while(@$f=readdir($dir)){
if($f=="." || $f=="..") continue;
if($apaya=="jpg"){ // HAPUS FILE JPG SAJA
if(!eregi(".jpg|.jpeg",$f)) continue;
}
else if($apaya=="other"){ // HAPUS SELAIN FILE JPG
if(eregi(".jpg|.JPG",$f)) continue;
}
// $input="saved/$f";
// $output="public_html/$savedir/$f";
// $h = fopen("saved/$f", 'r');
// $fdata = fread($h, filesize($input));
// fclose($h);
// $h = fopen($output, 'wb');
// $ok = fwrite($h, $fdata);
// fclose($h);
// copy("saved/$f",".$savedir2/$f");
rename("saved/$f",".$savedir2/$f");
@unlink("saved/$f");
@unlink("thumb/$f");
}
}
see in fopen fuctions? its dont work both too...
pls help me out of this problem..
thx (if u've a free time, i can give you a FTP account to see all script i putted in free host i used. then please fix it for me.)
hmmm, thx again!
Last edited by 0beron; 03-14-2005 at 01:49 PM..
Reason: Added [ php ] tags
|