aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/js/upload.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/public/js/upload.js b/public/js/upload.js
index 4795679..0696af6 100644
--- a/public/js/upload.js
+++ b/public/js/upload.js
@@ -1,5 +1,4 @@
var maxSize = '512';
-var urlPrefix = '';
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
@@ -10,8 +9,6 @@ xhr.onreadystatechange = function() {
}
if(xhr.responseText.maxFileSize)
maxSize = xhr.responseText.maxFileSize;
- if(xhr.responseText.urlPrefix)
- urlPrefix = xhr.responseText.urlPrefix + '/';
}
}
xhr.open('GET', '/api/info', true);
@@ -45,7 +42,7 @@ window.onload = function () {
dropzone.on("success", function(file, response) {
// Handle the responseText here. For example, add the text to the preview element:
a = document.createElement('a');
- a.href = window.location.origin + '/' + urlPrefix + response.filename;
+ a.href = response.url;
a.target = '_blank';
a.innerHTML = response.filename;