v1234's avatar

"Not allowed to load local resource" problem Laravel 5

Hi, i'm trying to upload image using ajax. i'm on windows, using XAMPP and laravel 5 .

//[1] First i tried to upload images in asset but failed as it shows Directory is not writable. tried searching solution to make it writable but failed

//[2] So i tried to upload image to public folder However i'm able to upload image to "public/img" folder but not able to retrieve it. google chrome shows the follwing error

Not allowed to load local resource: file:///D:/office_work/bsi/public/img/Jellyfish.jpg

If i click on this image link i'm able to see it in browser but i'm not able to use the same link in 'src' attribut of image tag.

Ex.

this tag also shows the same error as above(Not allowed to load local resource) I'm trying to fix this code since past 2 days tried lots of different thing with help of previous discussion online but couldn't find the solution. i'm not able to figure it out that why it is happening.

Plz help if someone already encountered with the same problem or anybody who can guide me to understand root of this problem better or any possible solution.

0 likes
1 reply
v1234's avatar

the broken link to image was a image tag with src attribute value as

public_path('img').'/'.'Jellyfish.jpg'

Please or to participate in this conversation.