Commits

christiansalazar committed b535810

now coco use mkdir for uploadDir

  • Participants
  • Parent commits a8ba51d

Comments (0)

Files changed (2)

File CocoWidget.php

 				return;
 			}
 
+			// ensure directory
+			$this->uploadDir = rtrim($this->uploadDir,'/').'/';
+			@mkdir($this->uploadDir);
+
 			$result = $uploader->handleUpload($this->uploadDir);
 			if(isset($result['success'])){
 				if($result['success']==true){
 			'onMessage'=>'function(m){ alert(m); }',
 			'allowedExtensions'=>array('jpeg','jpg','gif','png'),
 			'sizeLimit'=>2000000,
-			'uploadDir' => 'assets/', // please always remember to finish with an slash '/'
+			'uploadDir' => 'assets/', // coco will automatically perform @mkdir
 
 			// this arguments are used to send a notification
 			// on a specific class when a new file is uploaded,