<?php // define some constants $ftpserver = “ftp.boo.pl”; $ftpdirectory = “/public_html”; $download = “somefile-0.1.tar.gz”; $destdir = “/downloads”; if (!($ftp = ftp_connect($ftpserver))) { print(“Unable to connect to $ftpserver!<br>n”); exit(); } if (!ftp_login($ftp, “anonymous”, “someone@somehost.com”)) { print(“Unable to login.<br>n”); exit(); } ftp_pasv($ftp, FALSE); if(!ftp_chdir($ftp, $ftpdirectory)) { print(“Unable to change directory to $ftpdirectory!<br>n”); exit(); } if(!ftp_fget($ftp, $fp, $download, FTP_IMAGE)) { print(“Unable to download file $download!<br>n”); exit(); } ftp_quit($ftp); if(!rename($tempfile, $destdir . “/” . $download)) { print(“Unable to move file to destination directory!<br>n”); exit(); } ?>
ok skrypt loguje sie i pisze takie cos:
Warning: fclose(): supplied resource is not a valid stream resource in /home/accounts_m/macza/public_html/_/ftp.php on line 28
Warning: rename(): open_basedir restriction in effect. File(/_/index.php) is not within the allowed path(s): (/home/accounts_m/macza:/tmp) in /home/accounts_m/macza/public_html/_/ftp.php on line 30
Unable to move file to destination directory!
co mam zrobic zeby zgrywalo mi to? please pomóżcie! ;p