Posted by Daniel Tryba on 10/04/17 11:17
In comp.lang.php Ivan Omelchenko 608308824 <news@omelchenko.com> wrote:
>> // The file is generated and its handler is contained by $file...
>> header('Content-type: application/javascript');
>> header("Content-length: ".filesize($file));
>> header('Content-Disposition: attachment; filename="destination_name.js"');
>> readfile($file);
>>
> Hows about $file that weight more then 8Mb ?
> You can't do it with movie, for example.
Why do you think that? readfile() "Reads a file and writes it to the
output buffer." [http://nl3.php.net/readfile]. So it doesn't use any
memory in php other than:
-the buffers to read the file and write to the output buffer.
-the output buffer _if_ output buffering in php is set to on, not
something you want to do in these kind of scripts...
Navigation:
[Reply to this message]
|