Unable to receive the s3 path url via file upload live
FileUpload::make('file')
->label('File Upload')
->visible(fn() => $question?->type === QuestionTypeEnum::SINGLE_FILE_UPLOAD->value)
->live()
->disk('s3')
->afterStateUpdated(function (
$record,
$state,
FileUpload $component,
$livewire
) {
\Log::info('File upload state:', ['state' => $state]);
return $this->handleFileUploadAnswer($state);
})
->directory(function () use ($periodId, $subjectId, $instituteId) {
return "{$instituteId}/{$periodId}/{$subjectId}/subject-tasks/questions/files";
})
->acceptedFileTypes(FileTypeEnum::from($question->file_mime)->mimeTypes())
->maxSize($question->file_size * 1024 * 1024)
->required(fn() => $question?->type === QuestionTypeEnum::SINGLE_FILE_UPLOAD->value)
->columnSpanFull(),
this should be return the uploaded to s3 link. but it instead returning tmp path.
[2025-06-06 21:12:45] local.INFO: File upload state: {"state":{"Livewire\Features\SupportFileUploads\TemporaryUploadedFile":"C:\Users\KagChi\AppData\Local\Temp\phpCE92.tmp"}}
->label('File Upload')
->visible(fn() => $question?->type === QuestionTypeEnum::SINGLE_FILE_UPLOAD->value)
->live()
->disk('s3')
->afterStateUpdated(function (
$record,
$state,
FileUpload $component,
$livewire
) {
\Log::info('File upload state:', ['state' => $state]);
return $this->handleFileUploadAnswer($state);
})
->directory(function () use ($periodId, $subjectId, $instituteId) {
return "{$instituteId}/{$periodId}/{$subjectId}/subject-tasks/questions/files";
})
->acceptedFileTypes(FileTypeEnum::from($question->file_mime)->mimeTypes())
->maxSize($question->file_size * 1024 * 1024)
->required(fn() => $question?->type === QuestionTypeEnum::SINGLE_FILE_UPLOAD->value)
->columnSpanFull(),
this should be return the uploaded to s3 link. but it instead returning tmp path.
[2025-06-06 21:12:45] local.INFO: File upload state: {"state":{"Livewire\Features\SupportFileUploads\TemporaryUploadedFile":"C:\Users\KagChi\AppData\Local\Temp\phpCE92.tmp"}}