Programming
PHP script for fetching 4GB file from URL to your Server
       Below is the php script for fetching 4GB file from URL to your Server. The ini_set(‘upload_max_filesize’, ‘5000M’), ini_set(‘post_max_size’, ‘5000M’) statements specifies the maximum size of the data to fetch/upload by the script, if we want to fetch file of size 10GB then we can easily do so simply by changing the 2nd parameter(size in megabytes) of this calls. Next important setting is set_time_limit (24 * 60 * 60) which specifies the maximum time in seconds for running this script  ( as downloading file size is more it takes more time). Note that this time totally depends on the size of the file you want to fetch and the network speed of your server.
         If you are thinking of running this script on general hosting service (where network speed is less) then it requires more time to execute (may be in Hrs) so, accordingly  you should set execution time limit. I had tested it on my local machine as well as on hosting service although it takes more CPU resource but works fine. I recommend to use it only for personal use. Its totally inefficient for bulk fetches, most of hosting services do not recommend such scripts because it simply  overloads their resources.

 

 

 

Tag

Related Post

Leave a Reply