How do I download files of big sizes from somewhere on the web to the web server with PHP? Also, what should be allowed on the server in order to make this happen? Thanks.
You need CURL module installed on PHP.
Then create a folder on the server to save the downloaded files and set write permissions so that the webserver can write to that folder. Then just modify this PHP-script to download whatever file you want, just change the URL and the target filename (my example downloads Opera 10 disk image for Mac):
The CURLOPT_TIMEOUT sets the maximum time CURL can use to download the file, note also that if the downloads take long time to finish, you might need to modify the PHP execution timeout in php.ini.
|show 1 more comment|