Answer the question
In order to leave comments, you need to log in
How in laravel to access a file from a controller through a path located in a folder?
The file /storage/private/1.jpeg (there is a symlink. In nginx I cut off viewing private)
(via a relative path ala ../ ) does not find
It turned out to be accessed only if I put it in public in this way:
$filename = '1.jpeg';;
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
fclose($handle);
header("content-type: image/jpeg");
echo $contents;
Answer the question
In order to leave comments, you need to log in
https://laravel.com/docs/7.x/filesystem#downloadin... well, and neighboring sections.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question