FileUpload loading image fails
Hello, I want to use the FileUpload. But when I have saved an image, it does not show it self and is also not downloadable.
what am I doing wrong?
7 Replies
right click inspect, what does the console say? I have a feeling you have a cors issue and your urls are not set correct.
It seems the FileUpload is not searching for the local storage, but for this:
https://admin.webinary.test/live/events/2/webinary.test/storage/Cat03.jpg
.
I dont know why.
Also the the Input is just this: FileUpload::make('header_image'),
;Solution
Because your .env APP_URL is set incorrectly.
It is just:
webinary.test
. But why it would look with such an odd url. the img can be found in the url: https://admin.webinary.test/Cat03.jpg
and https://dashboard.webinary.test/Cat03.jpg
.it should be:
https://admin.webinary.test
https://admin.webinary.test/live/events/ is the page, but because you entered a domain and not the URL you are getting a current url with the domain. That's why you need to set the APP_URL Correctly.
I have tried it, and now the hole website doesn't work. π
I want to note that the website has multiple (sub) domain names.
I think I see the problem. I used the APP_URL wrongly. In my code.π
unlink