@jlrdw Yes I did it. If the user deletes the file and then uploads an other, everything goes okay. But if the user wants to update some informations without replacing the file, this is my problem...
@Snapey this is from the controller the update methode
if (request()->hasFile('file_upload')) {
$document = resolve(StoreDocument::class)->execute($object, request()->file('file_upload'));
resolve(UploadDocumentFromFileContentAction::class)->execute($document, request()->file('file_upload')->getContent());
}
This is the uploadDocumentFromFileContentAction
class UploadDocumentFromFileContentAction
{
public function execute(Document $document, string $fileContent): void
{
throw_unless(
Storage::put($document->path . $document->file_name, $fileContent),
Exception::class,
'The file ' . $document->file_name . ' can not be stored in cloud.'
);
}