Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 948955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:19:37+00:00 2026-05-15T23:19:37+00:00

I am needing to download a very large file via PHP, the last time

  • 0

I am needing to download a very large file via PHP, the last time I did it manually via http it was 2.2gb in size and took a few hours to download. I would like to automate the download somehow.

Previously I have used

file_put_contents($filename, file_get_contents($url));

Will this be ok for such a large file? I will want to untar the file post downloading and then perform analysis of the various files inside the tarball.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:19:38+00:00Added an answer on May 15, 2026 at 11:19 pm

    file_get_contents() is handy for small files but it’s totally unsuitable for large files. Since it loads the entire file into memory you need like 2GB of RAM for each script instance!

    You should use resort to old fopen() + fread() instead.

    Also, don’t discard using a third-party download tool like wget (installed by default in many Linux systems) and create a cron task to run it. It’s possibly the best way to automate a daily download.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm needing to change a bunch of properties in a large amount of controls.
I am needing some information on including files in PHP classes. E.G. include Foo2.php;
I am needing to create a web service, so the first thing I did
I'm needing to create a zip file containing documents that exist on the server.
Needing some guidance about how to properly graph data that is very small and
I'm needing to load an XML document into PHP that comes from an external
I want know more about download a file when the directory is protected by
I'm just needing a simple bit of code for vb.net that will allow me
I am needing an inline image to position 1px below baseline. How can it
I am needing to transfer some logs which were timestamped in ticks to an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.