Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/FileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ public function tree($disk, $path): array
*
* @return array
*/
public function upload($disk, $path, $files, $overwrite): array
{
$fileNotUploaded = false;

$fileNotUploaded = false;
$notUploadedReason = "";
foreach ($files as $file) {
// skip or overwrite files
if (!$overwrite && Storage::disk($disk)->exists($path . '/' . $file->getClientOriginalName())) {
Expand All @@ -153,6 +151,7 @@ public function upload($disk, $path, $files, $overwrite): array
&& $file->getSize() / 1024 > $this->configRepository->getMaxUploadFileSize()
) {
$fileNotUploaded = true;
$notUploadedReason = "file is too large";
continue;
}

Expand All @@ -164,6 +163,7 @@ public function upload($disk, $path, $files, $overwrite): array
)
) {
$fileNotUploaded = true;
$notUploadedReason = "file type is not allowed";
continue;
}

Expand All @@ -189,7 +189,7 @@ public function upload($disk, $path, $files, $overwrite): array
return [
'result' => [
'status' => 'warning',
'message' => 'notAllUploaded',
'message' => $notUploadedReason,
],
];
}
Expand Down