Skip to content

Commit

Permalink
Improved error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Dec 11, 2015
1 parent 115609c commit 711e203
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/elfinder/php/elFinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,15 @@ protected function upload($args) {

foreach ($files['name'] as $i => $name) {
if (($error = $files['error'][$i]) > 0) {
$result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, $error == UPLOAD_ERR_INI_SIZE || $error == UPLOAD_ERR_FORM_SIZE ? self::ERROR_UPLOAD_FILE_SIZE : self::ERROR_UPLOAD_TRANSFER);
$result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, $error == UPLOAD_ERR_INI_SIZE || $error == UPLOAD_ERR_FORM_SIZE ? self::ERROR_UPLOAD_FILE_SIZE : self::ERROR_UPLOAD_TRANSFER) . " (error=" . $error . ")";
$this->uploadDebug = 'Upload error code: '.$error;
break;
}

$tmpname = $files['tmp_name'][$i];

if (($fp = fopen($tmpname, 'rb')) == false) {
$result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, self::ERROR_UPLOAD_TRANSFER);
$result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, self::ERROR_UPLOAD_TRANSFER) . " Unable to open tmp file.";
$this->uploadDebug = 'Upload error: unable open tmp file';
break;
}
Expand Down

0 comments on commit 711e203

Please sign in to comment.