Jump to content

[SOLVED] How to download a file with php?


ZuriJAckshoT

Recommended Posts

You don't really have to even use curl for this, you could use file_get_contents() or fopen(). It is definitely possible to do this in curl, it's just a bit overkill.

 

Thanks you  :)

 

Can I download binary files such as picture and movie files with those functions?

Yes, you may have to worry with big files though and not load them into memory all at once. You could stream it to save a huge memory hit all at once (but increase execution time), there is a good example of this here... http://www.php.net/manual/en/function.fread.php (the bottom example that uses feof.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.