Separate share transfers from Files storage and add folder upload to New transfer.
Deploy Ladill Transfer / deploy (push) Successful in 28s

Transfers lists only intentional shares while Files shows all storage, and New transfer accepts folder picks with flattened file uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-08 22:31:45 +00:00
co-authored by Cursor
parent be3b719437
commit 1a95915e21
9 changed files with 181 additions and 55 deletions
+5 -4
View File
@@ -149,6 +149,7 @@ class FileStorageService
DB::transaction(function () use ($user, $destination, $files, $resolutions, $maxBytes, &$uploaded) {
$destination = Transfer::query()->lockForUpdate()->findOrFail($destination->id);
$wasEmpty = $destination->files()->count() === 0;
$location = $destination->isStorageContainer() ? $destination : null;
foreach ($files as $file) {
if (! $file instanceof UploadedFile) {
@@ -163,15 +164,15 @@ class FileStorageService
$resolution = $resolutions[$originalName] ?? null;
if ($resolution === 'replace') {
$existing = $this->findByName($user, $destination->is_folder ? $destination : null, $originalName);
$existing = $this->findByName($user, $location, $originalName);
if ($existing) {
$this->transfers->deleteFile($existing);
}
$storedName = $originalName;
} elseif ($resolution === 'keep_both') {
$storedName = $this->uniqueFilename($user, $destination->is_folder ? $destination : null, $originalName);
$storedName = $this->uniqueFilename($user, $location, $originalName);
} else {
$existing = $this->findByName($user, $destination->is_folder ? $destination : null, $originalName);
$existing = $this->findByName($user, $location, $originalName);
if ($existing) {
throw new RuntimeException("A file named \"{$originalName}\" already exists. Choose replace or keep both.");
}
@@ -205,7 +206,7 @@ class FileStorageService
if ($folder !== null) {
$query->whereKey($folder->id);
} else {
$query->where('is_folder', false);
$query->where('is_folder', false)->where('is_root_storage', false);
}
})
->first();