Not allowed to load local Resource: file

Asked

Viewed 22 times

0

I’m having the following problem

Not allowed to load local Resource: file://E:/xampp/htdocs/TELO5%20-%20VERS%C3%83O%20DE%20TESTES/public/app/public/projects/resize/123/1QxyccEtRfvageUMESqc4dThi4P0YtxsbGG6JaO7.jpg

When I try to load an image to view from the Windows, I get this problem, even with the directory redirecting to the correct path the image appears corrupted in the browser

My code to receive the image and save

        $dados = $req->all();
    //Salvando as imagens adicionadas 
    if($req->hasFile('images')){
        foreach ($req->file('images') as $key => $imagem) {
            if($imagem->getMimeType() == 'image/jpeg' || $imagem->getClientSize() < 999999){
                $upload = $imagem->store('projetos/redimensionamento/' . $dados['id_redimensionamento']);
            }
        }
    }

My code to list images in the view controller

$imagens = Storage::files('projetos/redimensionamento/'. $redimensionamento[0]['id_afericao']);

My code in the view

            <div class="row justify-content-center">
                @foreach ($imagens as $imagem)
                    <img src="{{public_path('app/public/' . $imagem) }}">
                @endforeach
            </div>
  • Read on, https://laracasts.com/discuss/channels/laravel/show-images-from-storage-folder That would be about <img src="{{ Asset($imagem) }}">

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.