From: Jerome Jutteau Date: Sun, 15 Nov 2020 22:54:31 +0000 (+0100) Subject: [BUGFIX] always prefer using HTML5 features if available X-Git-Tag: 4.2.0~47 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/964faa704b2ed91aa5df77906cdb38909dff21b6?ds=sidebyside;hp=2cca8753a5d894f285a3dfbbac7bb7f76baf3cf9 [BUGFIX] always prefer using HTML5 features if available Classic uploads (one single post request) were used even if HTML5 features were available as an optimization to avoid more requests than needed. However, in case of badly configured server Jirafeau cannot try to resend a file with a lower size like async uploads. Now, the js client is always using async uploads if HTML5 feature is available. ref #234 Signed-off-by: Jerome Jutteau --- diff --git a/lib/functions.js.php b/lib/functions.js.php index 1527d01..ebf8531 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -577,8 +577,7 @@ 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) + if (check_html5_file_api ()) { async_upload_start ( max_size,