Click to See Complete Forum and Search --> : Copy larger size file from a URL to your web server.


PeejAvery
July 27th, 2006, 02:42 PM
Anyone know how to copy a larger size file, say about 20mb, from a URL to your web server?

This works but only with small files.
$filename = basename($file);
$handleread = fopen($file, 'r');
$handlewrite = fopen($filename, 'w');
while (!feof($handleread)) {
$source = fgets($handleread, 4096);
fwrite($handlewrite, $source);
}
fclose($handlewrite);
fclose($handleread);

PeejAvery
July 28th, 2006, 09:53 AM
Interesting, I just used copy() and it works. Before I couldn't copy. The PHP manual says something about fopen wrappers. Is that enabled on most web servers?

PeejAvery
July 30th, 2006, 11:27 PM
Well, it turns out that copy has a size limit. Anyone know what that is? Or is it the server limiting the size? Anyone know?