How to work with file uploads

HI, i am implementing file uploads for the first time and I am facing 2 problems: 1. after uploading the file and clicking save, it loads indefinitely (see screenshot) even though I can see it's been uploaded to my disk and it's filename saved to my DB. 2. When I reload this page, the file upload is empty again I'd like for it to show the already uploaded file so the user knows a file exists already. This is the code I am using to implement this:
FileUpload::make('signature')->acceptedFileTypes(['image/png'])->maxFiles(1),
FileUpload::make('signature')->acceptedFileTypes(['image/png'])->maxFiles(1),
No description
Solution:
figured out the other issue, turns out my column was set to hidden on my model
Jump to solution
5 Replies
dotdotdot
dotdotdotOP3w ago
problem 1. is fixed, but I still don't see my image when I reload the page
Solution
dotdotdot
dotdotdot3w ago
figured out the other issue, turns out my column was set to hidden on my model
blntgvn42
blntgvn423w ago
Hey @dotdotdot , I'm exactly having the first problem you have. Can you guide me through how you did solve it? nvm, i found a solution. If you have the same problem, make sure .env APP_URL same with the actual url
dotdotdot
dotdotdotOP3w ago
yep that was partly the problem
blntgvn42
blntgvn423w ago
just checked the console and solved the problem 🙂

Did you find this page helpful?