From b81cf72ac41f61e48a86d699e12fcfc327cefb14 Mon Sep 17 00:00:00 2001 From: kanadeko Date: Sat, 14 Jan 2017 18:13:58 -0300 Subject: Changed from ip whitelist to token based auth --- public/js/upload.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'public/js/upload.js') 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; -- cgit v1.2.3