我如何从url上传一个文件,这个文件需要时间重定向到php中的下载链接


how can i upload a file from a url that takes time to redirect to download link in php

如何从web url上传文件(例如。http://sourceforge.net/projects/portableapps/files/Notepad%2B%2B%20Portable/NotepadPlusPlusPortable_6.6.3.paf.exe/download?accel_key=69%3A1400559000%3Ahttp%253A//portableapps.com/apps/development/notepadpp_portable%3A30f2052f%24595d5fff42fb788669369f5578117033130abe18&click_id=9cd19f44-dfd4-11e3-90c3-200ac1d1d0b&source=accel(到我的服务器(而不是本地计算机(使用php??

您可以使用file_get_contentsfile_put_contents

$filename = 'file.tar.gz';
$url = 'http://mirrors.ispros.com.bd/apache//httpd/httpd-2.4.9.tar.gz';
file_put_contents($filename, file_get_contents($url));

您可以将cURL用于此或FTP

以下是PHP手册:http://www.php.net/manual/en/book.curl.php

http://www.php.net/manual/en/function.ftp-put.php

如果你想把它下载到一个你可以控制并运行PHP的服务器上,你可以这样使用CURL:如何在php中使用curl下载文件?