diff --git a/src/bulletproof.php b/src/bulletproof.php index 3a82895..7da136e 100644 --- a/src/bulletproof.php +++ b/src/bulletproof.php @@ -401,8 +401,11 @@ public function setStorage($dir = 'uploads', $permission = 0666) */ protected function constraintValidator() { - // handle naming of file - $this->setName(); + + // if name is provided use it, otherwise generate a unique name + if (!$this->name) { + $this->setName(); + } /* check image for valid mime types and return mime */ $this->getImageMime($this->_files['tmp_name']);