diff --git a/src/webui/www/public/upload.html b/src/webui/www/public/upload.html index c9bc1218f..2b46abdba 100644 --- a/src/webui/www/public/upload.html +++ b/src/webui/www/public/upload.html @@ -36,32 +36,33 @@ function uploadFiles(files) { } } -// file selection -function fileSelectHandler(e) { +function fileHandler(e) { + e.preventDefault(); // fetch FileList object - var files = e.target.files || e.dataTransfer.files; + var files = $('fileselect').files // process all File objects uploadFiles(files); } window.addEvent('load', function() { - $('fileselect').addEvent('change', fileSelectHandler); - // is XHR2 available? + // is XHR2 available? var xhr = new XMLHttpRequest(); - if (xhr.upload) - $('submitbutton').addClass("invisible"); - else - $('upload_frame').addEvent('load', function(e) { window.parent.closeWindows(); }); + if (xhr.upload) { + $('uploadForm').addEvent('submit', fileHandler); + } else { + $('upload_frame').addEvent('load', function() { window.parent.closeWindows(); }); + } }); -
- -
-
-
- + + +
+ +
+
+