What does the "file_functions" plugin do?

Created by sebikul
Keywords:
Last updated by:
sebikul

The "file_functions" plugin includes a couple of functions that enable you to send files to the client so that it can be downloaded with all the necessary information.

There are 2 functions inside this plugin, the first one enables you to send a file to the clients browser, and its use s extremely simple, here is an example:

================================================

<?php

include "init.php";

$file->download_file($stemp, '/path/to/local/file/the_file.zip' , 'filename_the_clients_reads.zip');

?>

================================================

Thats it, nothing else.

In the second function, we have taken file downloads to a step further, we have added speed limit to the client download speed, example is shown below: (as you can see its pretty much the same)

================================================

<?php

include "init.php";

$file->download_speedlimit($stemp, '/path/to/local/file/the_file.zip' , 'filename_the_clients_reads.zip', 30);

?>

================================================

The last parameter is the speed limit (in KB/s)