summaryrefslogtreecommitdiffstats
path: root/system/libraries/Upload.php
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2009-02-16 16:44:32 +0100
committerDerek Allard <derek.allard@ellislab.com>2009-02-16 16:44:32 +0100
commit616dab8bcaffb3ae2c22a51c84314ebe259401d4 (patch)
tree282a3c64f69b9effdbe1d3d803e7bd9a23688bbf /system/libraries/Upload.php
parentd70b064ca3d38115ec53c38528fe7c02a9ddcf97 (diff)
Added the ability to pass $config['file_name'] for the File Uploading Class and rename the uploaded file.
Diffstat (limited to 'system/libraries/Upload.php')
-rw-r--r--system/libraries/Upload.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 6309caee3..03a7b21f6 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -911,11 +911,11 @@ class CI_Upload {
{
return $filename;
}
-
+
$parts = explode('.', $filename);
$ext = array_pop($parts);
$filename = array_shift($parts);
-
+
foreach ($parts as $part)
{
if ($this->mimes_types(strtolower($part)) === FALSE)
@@ -928,7 +928,8 @@ class CI_Upload {
}
}
- // file name override
+ // file name override, since the exact name is provided, no need to
+ // run it through a $this->mimes check.
if ($this->file_name != '')
{
$filename = $this->file_name;