File upload not showing after reload
I have added a FileUpload field.
When I try to upload a image, it shows the progress bar correcly, then a preview of the uploaded image, when I save the page the file is stored correctly in the directory requested and the database field is updated.
photos is text field and has array cast in the model
However when I reload the admin page the image is not shown anymore, and theres no resource failed to load in the network monitor.
Any ideas ?
3 Replies
Do you only show this field on Edit? Since
$record->name
will be empty on CreatePage
when I save the page the file is stored correctly in the directory requestedSeems like it isn't if you check the filepath. And this is probably your issue.
This is on the edit page yes, but good point that name wont be set on a create page.
The path looks ok, except for the added forward slash, no?
photos: "["apartments/A/photos//Peugeot_e-208_dynamic_front34.jpg"]",
semweb@dedi5139:~/public_html/demo$ ls public/storage/apartments/A/photos/
Peugeot_e-208_dynamic_front34.jpg
omg... I had a photoAttribute from before rewriting the admin panel to filament, which was stealing the database field.
It works now 🫣
Sorry. Thought the forward slash was because the name was missing. But that was further at the start