我有一個大文件(2GB),我想用服務器B下載到服務器A.使用PHP下載遠程文件(2GB)
我用PHP試過了FTP和CURL,但沒有成功。它會返回一個TIMEOUT REQUEST錯誤,即使我的set_time_limit()值爲0。
這裏是我的代碼:
<?php
set_time_limit(0)
$local_file = 'file.zip';
$server_file = '/www/file.zip';
$conn_id = ftp_connect("ftp.webmashing.com");
$login_result = ftp_login($conn_id, "USERNAME", "PASSWORD");
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_file\n";
} else {
echo "There was a problem\n";
}
ftp_close($conn_id);
?>
是'safe_mode'上?另一方面,如果它是那麼大(cronjobs,或者齒輪工人),我會把它委託給非http進程。 – Wrikken 2012-01-14 13:47:59