]> git.p6c8.net - jirafeau/pcanterino.git/commitdiff
Added config option to enforce legacy synchronous file upload
authorPatrick Canterino <patrick@patrick-canterino.de>
Fri, 29 May 2026 14:57:14 +0000 (16:57 +0200)
committerPatrick Canterino <patrick@patrick-canterino.de>
Fri, 29 May 2026 14:57:14 +0000 (16:57 +0200)
This is useful for debugging, we use it for issue #48

lib/config.original.php
lib/functions.js.php

index 6b7c342e51cf7a1402774266016c0862f14a770c..e77684bda429dd0c3e8c54a6ff738b119e6382c9 100644 (file)
@@ -235,6 +235,10 @@ $cfg['installation_done'] = false;
  */
 $cfg['debug'] = false;
 
  */
 $cfg['debug'] = false;
 
+/* Enable this debug flag to enforce the legacy (synchronous) file upload mechanism.
+ */
+$cfg['debug_enforce_legacy_upload'] = false;
+
 /* Set Jirafeau's maximal upload chunk
  * When Jirafeau upload a large file, Jirafeau sends several data chunks to fit server's capabilities.
  * Jirafeau tries to upload each data chunk with the maximal size allowed by PHP (post_max_size and upload_max_filesize).
 /* Set Jirafeau's maximal upload chunk
  * When Jirafeau upload a large file, Jirafeau sends several data chunks to fit server's capabilities.
  * Jirafeau tries to upload each data chunk with the maximal size allowed by PHP (post_max_size and upload_max_filesize).
index 29d50c198edfbc321a0d1855eadd8624f4baa15b..4e957475580fa880e86479a21f2fe864651b0473 100644 (file)
@@ -479,6 +479,13 @@ function classic_upload (file, time, password, one_time)
 
 function check_html5_file_api ()
 {
 
 function check_html5_file_api ()
 {
+<?php
+    if (isset($cfg['debug_enforce_legacy_upload']) && $cfg['debug_enforce_legacy_upload']) { ?>
+    // Enforce legacy upload is enabled through config!
+    return false;
+<?php
+    }
+?>
     return window.File && window.FileReader && window.FileList && window.Blob;
 }
 
     return window.File && window.FileReader && window.FileList && window.Blob;
 }
 

patrick-canterino.de