CC-323: Show appropriate error message if disk is full when attempting to upload files via the web UI

- Updated the StoreFile logic so it won't die while trying to copy a file, and instead pass error messages to the controller which can decide if it wants to die, which 	I've set ApiController and PluploadController todo on receipt of error code.
This commit is contained in:
Daniel 2012-02-14 18:12:29 -05:00
parent 9fc0ed198e
commit 14cd9ed0e9
3 changed files with 39 additions and 29 deletions

View file

@ -38,8 +38,10 @@ class PluploadController extends Zend_Controller_Action
$upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
$filename = $this->_getParam('name');
$tempname = $this->_getParam('tempname');
Application_Model_StoredFile::copyFileToStor($upload_dir, $filename, $tempname);
$result = Application_Model_StoredFile::copyFileToStor($upload_dir, $filename, $tempname);
if (isset($result)){
die('{"jsonrpc" : "2.0", "error" : {"code": '.$result[code].', "message" : "'.$result[message].'"}}');
}
die('{"jsonrpc" : "2.0"}');
}
}