The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

use an external app

You shouldn't be using file_get_contents, or any other PHP functions IMO. None of them will be able to handle 3.5GB (most will agressivly cache the contents into memory - causing you to hit both the php memory limit, the file limits and script execution time (see php.ini)

You are probably getting errors now because of one of those 3 reasons, or you have safe mode switched on (IIRC http over file_get_contents only works with safe mode off, and you also might have to exclusively allow it in php.ini)

That being said though, the best solution to your problem is to call an external program that can handle the file download. On UNIX you can use either fetch or wget, eg.

or you can use the much better proc_open command, which I would recommend since your download will take a while to complete (and proc_open() lets you query the status of the externally running program using proc_get_status() - so you can give feedback on download progress etc.)

the output from the download program you use (eg. wget) will go straight into a stream, so you can read it and parse it (parse for errors, etc.)

if you are on windows, you could use wget.exe (which is a win32 port of wget with required cigwin libraries) and the same PHP functions

doing the updates this way is *much* better than what you are doing now

FTP is the appropriate protocol for files bigger than 1Mb - not HTTP. PHP should be able to handle files of any size provided that the function calls that use the appropriate protocol for the size of the file are used.