mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Fix FilePond: maxFileSize as bytes + temp files survive page reload
1. maxFileSize bug: FileValidateSize plugin overrides core's maxFileSize
setter. Core uses toBytes('1GB') = 1073741824, but plugin registers
maxFileSize as [null, Type.INT] which calls toInt('1GB') = 1.
Fix: all maxFileSize and perExtensionMaxSize values as raw bytes.
Also fix option name: fileValidateSizeFilterItem → fileValidateSizeFilter.
2. Temp file persistence: files uploaded via FilePond went to
tmp/filepond/ and vanished from the UI on page reload because
data-existing-files only included DB-persisted files.
Fix: session-track temp file_ids in handleProcess, inject via
getSessionTempFiles() into data-existing-files, teach handleLoad
to stream temp files from disk, and route JS remove → revert for hex IDs.
This commit is contained in:
@@ -45,6 +45,14 @@ if ($thesisId) {
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// Include session temp files so uploads survive page reload
|
||||
require_once APP_ROOT . '/src/FilepondHandler.php';
|
||||
$tempFiles = FilepondHandler::getSessionTempFiles($queueType);
|
||||
foreach ($tempFiles as $tf) {
|
||||
$result[] = $tf;
|
||||
}
|
||||
|
||||
return $result;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user