Welcome Guest, Not a member yet? Register   Sign In
file explorer and force_download
#2

[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-gui...elper.html

Quote:force_download('filename', 'data')

Generates server headers which force data to be downloaded to your desktop. Useful with file downloads. The first parameter is the name you want the downloaded file to be named, the second parameter is the file data. Example:
$data = 'Here is some text!';
$name = 'mytext.txt';

force_download($name, $data);

If you want to download an existing file from your server you'll need to read the file into a string:
$data = file_get_contents("/path/to/photo.jpg"); // Read the file's contents
$name = 'myphoto.jpg';

force_download($name, $data);


Messages In This Thread
file explorer and force_download - by El Forum - 01-20-2010, 03:58 PM
file explorer and force_download - by El Forum - 01-20-2010, 04:02 PM
file explorer and force_download - by El Forum - 01-21-2010, 03:51 AM
file explorer and force_download - by El Forum - 01-21-2010, 04:58 AM
file explorer and force_download - by El Forum - 01-21-2010, 07:26 AM
file explorer and force_download - by El Forum - 01-21-2010, 08:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB