diff options
author | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
---|---|---|
committer | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
commit | b6d8b962e44202a74c9b9321a4a53f61a753fccf (patch) | |
tree | 2d3c533a55964a0d124f7cd6bb1d3d98c7b84056 /user_guide_src/source/helpers/download_helper.rst | |
parent | 41713aaa665189dd0a191c333c73c4a7b9f37c78 (diff) | |
parent | 29e12641a1bb952f493462db6757ae12c7da1f2c (diff) |
Merge branch 'develop' into patch-1
Conflicts:
system/libraries/Calendar.php
Diffstat (limited to 'user_guide_src/source/helpers/download_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/download_helper.rst | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst index 860c568b9..f374d491f 100644 --- a/user_guide_src/source/helpers/download_helper.rst +++ b/user_guide_src/source/helpers/download_helper.rst @@ -4,7 +4,12 @@ Download Helper The Download Helper lets you download data to your desktop. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + + <div class="custom-index container"></div> Loading this Helper =================== @@ -13,38 +18,39 @@ This helper is loaded using the following code:: $this->load->helper('download'); +Available Functions +=================== + The following functions are available: -force_download() -================ -.. php:function:: force_download($filename = '', $data = '', $set_mime = FALSE) +.. function:: force_download([$filename = ''[, $data = ''[, $set_mime = FALSE]]]) :param string $filename: Filename :param mixed $data: File contents :param bool $set_mime: Whether to try to send the actual MIME type - :returns: void + :rtype: void -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. + 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. -If you set the second parameter to NULL and ``$filename`` is an existing, readable -file path, then its content will be read instead. + If you set the second parameter to NULL and ``$filename`` is an existing, readable + file path, then its content will be read instead. -If you set the third parameter to boolean TRUE, then the actual file MIME type -(based on the filename extension) will be sent, so that if your browser has a -handler for that type - it can use it. + If you set the third parameter to boolean TRUE, then the actual file MIME type + (based on the filename extension) will be sent, so that if your browser has a + handler for that type - it can use it. -Example:: + Example:: - $data = 'Here is some text!'; - $name = 'mytext.txt'; - force_download($name, $data); + $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 -do the following:: + If you want to download an existing file from your server you'll need to + do the following:: - // Contents of photo.jpg will be automatically read - force_download('/path/to/photo.jpg', NULL);
\ No newline at end of file + // Contents of photo.jpg will be automatically read + force_download('/path/to/photo.jpg', NULL);
\ No newline at end of file |