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
toeknee
toeknee3mo ago
Please provide the code for the form.
cmpDocs
cmpDocs3mo ago
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(), ]); }
toeknee
toeknee3mo ago
try ->deletable(true)
cmpDocs
cmpDocs3mo ago
No Sr., it doesn't work
No description
toeknee
toeknee3mo ago
Ok so you have the spinner you don't have access to load the file, that is the issue. check your network logs
cmpDocs
cmpDocs3mo ago
If i try ->openable() or ->downable() it work... I don´t understand!
Vp
Vp3mo ago
can you show the screenshot of "working", just curious
toeknee
toeknee3mo ago
It's It'll be a CORS issue right click, inspect youll see the console error.
cmpDocs
cmpDocs3mo ago
No description
cmpDocs
cmpDocs3mo ago
No description
cmpDocs
cmpDocs3mo ago
Thank you Sr., be more specific please!
cmpDocs
cmpDocs3mo ago
No description
toeknee
toeknee3mo ago
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
Vp
Vp3mo ago
You said "If i try ->openable() or ->downable() it work..." so curious to see how this is working in UI level (fileupload)
toeknee
toeknee3mo ago
Because it's a CORS issue, these both open the file directly and not embed into the website.
cmpDocs
cmpDocs3mo ago
How can i check this please? in the .env file?
toeknee
toeknee3mo ago
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.
cmpDocs
cmpDocs3mo ago
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!
toeknee
toeknee3mo ago
Perfect.