]> git.p6c8.net - jirafeau_project.git/blobdiff - lib/functions.js.php
Make one time download optional
[jirafeau_project.git] / lib / functions.js.php
index 1f83ae75d08343d3f36b3c9385b16e01db7d7d89..b2580b512b9d3029a508868a290b4b733f768e9b 100644 (file)
@@ -558,6 +558,8 @@ function async_upload_end (code)
 
 function upload (max_size)
 {
+    var one_time_checkbox = document.getElementById('one_time_download');
+    var one_time = one_time_checkbox !== null ? one_time_checkbox.checked : false;
     if (check_html5_file_api ()
         && document.getElementById('file_select').files[0].size >= max_size)
     {
@@ -566,7 +568,7 @@ function upload (max_size)
             document.getElementById('file_select').files[0],
             document.getElementById('select_time').value,
             document.getElementById('input_key').value,
-            document.getElementById('one_time_download').checked,
+            one_time,
             document.getElementById('upload_password').value
             );
     }
@@ -576,7 +578,7 @@ function upload (max_size)
             document.getElementById('file_select').files[0],
             document.getElementById('select_time').value,
             document.getElementById('input_key').value,
-            document.getElementById('one_time_download').checked,
+            one_time,
             document.getElementById('upload_password').value
             );
     }

patrick-canterino.de