Add custom upload confirmation and flatten folder uploads to individual files.
Deploy Ladill Transfer / deploy (push) Successful in 35s
Deploy Ladill Transfer / deploy (push) Successful in 35s
Users confirm uploads in a Ladill modal before transfer, and folder picks upload flat file names into the current location instead of preserving local directory paths. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -126,7 +126,7 @@ class FileStorageService
|
||||
throw new RuntimeException($file->getClientOriginalName().' exceeds the maximum file size.');
|
||||
}
|
||||
|
||||
$originalName = $file->getClientOriginalName() ?: 'file';
|
||||
$originalName = $this->basenameFilename($file->getClientOriginalName() ?: 'file');
|
||||
$resolution = $resolutions[$originalName] ?? null;
|
||||
|
||||
if ($resolution === 'replace') {
|
||||
@@ -193,4 +193,12 @@ class FileStorageService
|
||||
|
||||
return $candidate;
|
||||
}
|
||||
|
||||
private function basenameFilename(string $filename): string
|
||||
{
|
||||
$normalized = str_replace('\\', '/', trim($filename));
|
||||
$base = basename($normalized);
|
||||
|
||||
return $base !== '' ? $base : 'file';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user