summaryrefslogtreecommitdiff
path: root/static/upload.php
diff options
context:
space:
mode:
authorPeter Lejeck <peter.lejeck@gmail.com>2013-11-01 01:40:10 +0100
committerPeter Lejeck <peter.lejeck@gmail.com>2013-11-01 01:40:10 +0100
commitcfb6ce0d349280c260299c3dee6771a5228f4de5 (patch)
tree49c9468e826e8636ebd918f0aaee31e5a9d0df28 /static/upload.php
parent431357168b22a0c4a4f7dbd022e770cd2b734bdc (diff)
Fix deduplication
Diffstat (limited to 'static/upload.php')
-rw-r--r--static/upload.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/static/upload.php b/static/upload.php
index da5e311..e2a3016 100644
--- a/static/upload.php
+++ b/static/upload.php
@@ -56,7 +56,12 @@ function upload_file ($file) {
// the previous data.
if ($result['hash'] === $file->get_sha1()) {
unlink($file->tempfile);
- return $result;
+ return array(
+ 'hash' => $result['hash'],
+ 'name' => $file->name,
+ 'url' => $result['filename'],
+ 'size' => $result['size']
+ );
} else {
// Generate a name for the file
$newname = generate_name($file);