Download big files from web to server over PHP without WGET or SSH Access


  • Create a new php file as “download.php” in a public directory with the above code in it.
  • Change the content of “$destination_folder” if needed.
  • Create a new folder to store the downloaded file as “downloads” in the same directory as of download.php.
  • Open the “download.php” file using browser and enter the location of file to be downloaded.
  • Download will begin in background.

Note: You may need to setup php.ini config file as per your need. For my 200MB file, I set max_execution_time = 90000, max_input_time = 90000 and memory_limit = 256M. In shared hosting environment, a php.ini file can be placed in “public_html” folder.

References:
http://4rapiddev.com/php/download-image-or-file-from-url/
http://stackoverflow.com/questions/3938534/download-file-to-server-from-url

Leave a Reply

Your email address will not be published. Required fields are marked *