Skip to content

Commit

Permalink
When upload succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
telerim committed Jul 28, 2015
1 parent f351f1a commit f65be3c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Controller/UploadsController.php
Expand Up @@ -58,16 +58,19 @@ public function upload($dir=null) {
}

if (sizeof($result) > 0) {
$this->set("result", htmlspecialchars(json_encode($result), ENT_NOQUOTES));
$this->response->type('json');
// There was an issue with the upload
$this->response->statusCode(400);
} else {
// The upload was a success
$result = array('ok' => 'upload success');
$this->response->statusCode(200);
}
$this->response->type('json');
$this->set("result", htmlspecialchars(json_encode($result), ENT_NOQUOTES));
}

/**
*
* delete a file
*
* Thanks to traedamatic @ github
*/
public function delete($file = null) {
Expand Down

0 comments on commit f65be3c

Please sign in to comment.