change fileupload field preview url

can i change the preview url of a uploaded file? dont want to use s3 for preview (only storage )
Solution:
You'd need to use a getTemporaryUrl method override for the S3 driver where you use a local route which fetches the assets and returns it for you.
Jump to solution
3 Replies
Solution
toeknee
toeknee5mo ago
You'd need to use a getTemporaryUrl method override for the S3 driver where you use a local route which fetches the assets and returns it for you.
marksman
marksmanOP5mo ago
its a laravel thing filament just calls storage::url() ? seems to only call temporary on non public files tho
if ($component->getVisibility() === 'private') {
try {
$url = $storage->temporaryUrl(
$file,
now()->addMinutes(5),
);
} catch (Throwable $exception) {
// This driver does not support creating temporary URLs.
}
}

$url ??= $storage->url($file);
if ($component->getVisibility() === 'private') {
try {
$url = $storage->temporaryUrl(
$file,
now()->addMinutes(5),
);
} catch (Throwable $exception) {
// This driver does not support creating temporary URLs.
}
}

$url ??= $storage->url($file);
but that helps, thank you
toeknee
toeknee5mo ago
Exactly, you are welcome.
Want results from more Discord servers?
Add your server