Removing files from a record
Hi, i hope you all are fine! I need help please: when i'm going to edit a record that have a file attached, i cant remove it, just there is not a buttom to do it. What can i do? Thanks a lot!
19 Replies
Please provide the code for the form.
use Filament\Forms\Components\FileUpload;
public static function form(Form $form): Form
{
return $form
->schema([
FileUpload::make('evidence')
->label('Evidencia fotográfica')
->multiple()
->preserveFilenames()
->columnSpanFull(),
]);
}
try ->deletable(true)
No Sr., it doesn't work
Ok so you have the spinner
you don't have access to load the file, that is the issue. check your network logs
If i try ->openable() or ->downable() it work... I don´t understand!
can you show the screenshot of "working", just curious
It's It'll be a CORS issue
right click, inspect youll see the console error.
Thank you Sr., be more specific please!
It's exactly as I said a CORS issue. You are loading the image over a different url to the application url. Browsers do not allow this natively from the headers in laravel. Check the url that is trying to load the image vs the url you are accessing filament through. Its usually http vs https
You said "If i try ->openable() or ->downable() it work..." so curious to see how this is working in UI level (fileupload)
Because it's a CORS issue, these both open the file directly and not embed into the website.
How can i check this please?
in the .env file?
Do you not know how to use a browser console and network log inspection?
The network logs in the browser inspection tools shows you the urls being called. Check the differences.
i'm going to inspect this, and i'll be back later. At the moment i have to take my children to their school. Thanks a lot Sr.!
Ok, i'm here again! I'm sorry if I bother you Sr. All i had to do was to add 'www' to the 'APP_URL' in the .env file... "It's usually about something insignificant" jejeje Have a nice day!
Perfect.