diff options
author | Andrey Andreev <narf@devilix.net> | 2017-06-19 10:33:58 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-06-19 10:33:58 +0200 |
commit | 6c7a4266410070d30f8f6bcdf9c9e67f3d6478e3 (patch) | |
tree | f0aab8f6f5e781d5947b1a5553b6648eb7b7a4ab /user_guide_src/source/helpers/download_helper.rst | |
parent | 2459285b91d6fc4f5099f9f597529cce1059cb33 (diff) |
[ci skip] 3.1.5 release
Diffstat (limited to 'user_guide_src/source/helpers/download_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/download_helper.rst | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst deleted file mode 100644 index 1a4065073..000000000 --- a/user_guide_src/source/helpers/download_helper.rst +++ /dev/null @@ -1,56 +0,0 @@ -############### -Download Helper -############### - -The Download Helper lets you download data to your desktop. - -.. contents:: - :local: - -.. raw:: html - - <div class="custom-index container"></div> - -Loading this Helper -=================== - -This helper is loaded using the following code:: - - $this->load->helper('download'); - -Available Functions -=================== - -The following functions are available: - - -.. php: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 - :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. - - 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. - - 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 - do the following:: - - // Contents of photo.jpg will be automatically read - force_download('/path/to/photo.jpg', NULL);
\ No newline at end of file |