diff options
Diffstat (limited to 'static/upload.php')
| -rw-r--r-- | static/upload.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/static/upload.php b/static/upload.php index 4dc45a3..21ae386 100644 --- a/static/upload.php +++ b/static/upload.php @@ -93,7 +93,6 @@ function upload_file($file) $result = $q->fetch(); if ($result['count'] > 0) { unlink($file->tempfile); - return array( 'hash' => $file->get_sha1(), 'name' => $file->name, @@ -132,11 +131,10 @@ function upload_file($file) $q->bindValue(':exp', null, PDO::PARAM_STR); $q->bindValue(':del', sha1($file->tempfile), PDO::PARAM_STR); $q->execute(); - return array( 'hash' => $file->get_sha1(), 'name' => $file->name, - 'url' => POMF_URL.$newname, + 'url' => $newname, 'size' => $file->size, ); } else { @@ -196,6 +194,7 @@ function refiles($files) } $type = isset($_GET['output']) ? $_GET['output'] : 'json'; + $response = new Response($type); if (isset($_FILES['files'])) { @@ -212,3 +211,5 @@ if (isset($_FILES['files'])) { } else { $response->error(400, 'No input file(s)'); } + + |
