summaryrefslogtreecommitdiff
path: root/static/upload.php
diff options
context:
space:
mode:
authorpantsucat <contact@pantsu.cat>2015-09-17 15:12:51 +0200
committerpantsucat <contact@pantsu.cat>2015-09-17 15:12:51 +0200
commit1411bce1dc13bf6fea66b5899ba29d50d5c53bb0 (patch)
tree9250c2dbfa29930ff3fade33dacadc2839c98177 /static/upload.php
parent55fb54d3cdef2220d4208e614201311b0a2bb322 (diff)
Add html response class
Diffstat (limited to 'static/upload.php')
-rw-r--r--static/upload.php7
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)');
}
+
+