Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

410
Visualizações
Laravel 5.4 storage file not found

I am using laravel 5.4. I upload some document file in storage/app/public/documents folder like

$request->paper_file->store('documents');

and my file uploaded successfully.

in file system default storage is public and public conf is like

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',],

but when i hit /storage/documents/hQqlgifnVVH8bmrRPVdZ9aFGbhLmcc7g7bHZSX4u.pdf it says not found 404. How to solve this issue.

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

By default Laravel puts files in the storage/app/public directory, which is not accessible from the outside web. So you have to create a symbolic link between that directory and your public one:

storage/app/public -> public/storage

You can do that by executing the php artisan storage:link command (docs).

about 4 years ago · Santiago Trujillo Relatório

0

This problem happen to me after moving project to different folder. If you already have storage link generated, try to delete public/storage folder and run again:

php artisan storage:link
about 4 years ago · Santiago Trujillo Relatório

0

In laravel ^5.8:

  • Make sure you run the command php artisan storage:link to link storage/app/public with public/storage.

now:

// this return some like 'public/documents/file.ext'
$path = $request->paper_file->store('public/documents');

// this return some like 'storage/documents/file.ext'
$publicPath = \Storage::url( $path) );

// this return some like '< APP_URL env variable >/storage/documents/file.ext'
$url = asset( $publicPath );

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda