-
storage/app/publiclinks to https://my-website.com/storage which means you must havestorage/app/public/uploads/iotpark/warranty/48_00C1D156_1602499479.jpg - Try loading https://my-website.com/uploads/iotpark/warranty/ what do you get?
- Do you have SSH or some interface to check on the permissions of the folder and JPG?
Loading An Image From Public Storage - 403 (Forbidden)
Hi,
In one of my blade views, I am trying to display an image by doing:
<img src="<?php echo asset("storage/uploads/iotpark/warranty/$currentFile")?>"></img>
The image is stored in my-website.com>public>storage>uploads>iotpark>warranty.
However, when visiting the page on my browser, the image is not loaded and when inspecting in Chrome's console, the following error is shown:
GET https://my-website.com/storage/uploads/iotpark/warranty/48_00C1D156_1602499479.jpg 403 (Forbidden)
I have run php artisan storage:link in my server's command prompt, and the links were created.
- This worked well locally and I did not have any errors. Only happening online.
What could it be caused by please?
Thanks! Brian
Hi,
I ended up using a controller (ImageController) and protected route (using middleware) to 'return' the image requested by the view, to the view itself.
This is a different approach from the one above, because I then realized that I needed to have my images accessible only for the users requiring them in the view.. I could not place them in a public directory.
Thanks for your suggestions! :)
Please or to participate in this conversation.