CI_Upload changes
- Method chaining support.
- A more abstract resetting of the default settings.
- Added an option to initialize() to disable resetting to default settings.
- Removed method mimes_types() and slightly optimized chunks of code where it was used.
- Added the ability to pass allowed_types as an array.
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 378494e..b654bc5 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -289,12 +289,15 @@
- :doc:`File Uploading Library <libraries/file_uploading>` changes include:
- - Added **max_filename_increment** config setting.
- - Added an **index** parameter to the ``data()`` method.
- - Added the **min_width** and **min_height** options for images.
+ - Added method chaining support.
+ - Added **max_filename_increment** and **file_ext_tolower** configuration settings.
+ - Added **min_width** and **min_height** configuration settings for images.
+ - Added **mod_mime_fix** configuration setting to disable suffixing multiple file extensions with an underscore.
+ - Added the possibility pass **allowed_types** as an array.
+ - Added an ``$index`` parameter to the method ``data()``.
+ - Added a ``$reset`` parameter to method ``initialize()``.
- Removed method ``clean_file_name()`` and its usage in favor of :doc:`Security Library <libraries/security>`'s ``sanitize_filename()``.
- - Added **file_ext_tolower** config setting.
- - Added **mod_mime_fix** option to disable suffixing multiple file extensions with an underscore.
+ - Removed method ``mimes_types()``.
- :doc:`Calendar Library <libraries/calendar>` changes include:
diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst
index d7ba3a6..d93acb8 100644
--- a/user_guide_src/source/libraries/file_uploading.rst
+++ b/user_guide_src/source/libraries/file_uploading.rst
@@ -201,7 +201,7 @@
directory must be writable and the path can be absolute or relative.
**allowed_types** None None The mime types corresponding to the types of files you allow to be
uploaded. Usually the file extension can be used as the mime type.
- Separate multiple types with a pipe.
+ Can be either an array or a pipe-separated string.
**file_name** None Desired file name If set CodeIgniter will rename the uploaded file to this name. The
extension provided in the file name must also be an allowed file type.
If no extension is provided in the original file_name will be used.
@@ -254,6 +254,13 @@
.. class:: CI_Upload
+ .. method:: initialize([array $config = array()[, $reset = TRUE]])
+
+ :param array $config: Preferences
+ :param bool $reset: Whether to reset preferences (that are not provided in $config) to their defaults
+ :returns: CI_Upload instance (method chaining)
+ :rtype: CI_Upload
+
.. method:: do_upload([$field = 'userfile'])
:param string $field: Name of the form field