diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-05-08 15:59:27 +0200 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-05-08 15:59:27 +0200 |
commit | ee0a7f0083e9e3e2e667211acd3909e71aa1ec47 (patch) | |
tree | 363e075af6634dc10d089956171e775557ac710a /user_guide/helpers/file_helper.html | |
parent | e50d1a82e7c24f507049ddb77afd9e1cbb29d7e8 (diff) |
Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
Added a Common Functions page to the userguide for globally available functions.
Diffstat (limited to 'user_guide/helpers/file_helper.html')
-rw-r--r-- | user_guide/helpers/file_helper.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index a88e5dfc9..3fa92462b 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -134,11 +134,14 @@ can optionally be added to the file names by setting the second parameter to TRU <p>Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.</p>
<p class="important"><strong>Note:</strong> The "writable" uses the PHP function is_writable() which is known to have issues on the IIS webserver. Consider using fileperms instead, which returns information from PHP's fileperms() function.</p>
-<h2>get_mime_by_extension('<var>path/to/file/</var>')</h2>
+<h2>get_mime_by_extension('<var>file</var>')</h2>
<p>Translates a file extension into a mime type based on config/mimes.php. Returns FALSE if it can't determine the type, or open the mime config file.</p>
-
-<p class="important"><strong>Note:</strong> This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.</p>
+<p>
+<code>$file = "somefile.png";<br />
+echo $file . ' is has a mime type of ' . get_mime_by_extension($file);</code>
+</p>
+<p class="critical"><strong>Note:</strong> This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.</p>
</div>
<!-- END CONTENT -->
|