So after analyzing my work, i found my problem is. The old file that deployed showing image because i have symlink and using storage in public folder, that is why it shows my image correctly. But the new file i uploaded in hosting, cant doing symlink which is store in storage root. While its not giving me storage data on my public. Did i my explaination catch you ? Can someone help me how i use storage root in my hosting website. Thanks very much
Uploading a file on Shared Hosting not showing Image
Hello,
I am deploy my website on Shared Hosting. When i deployed my website using old data from Localhost, it gives me the correct image. After that i try all the function within Controller, it gives me good result which is stored in database but. Then i try to uploading image in shared hosting. The controller works but my image not displayed.
case 1 : old files with image works in shared hosting
http://website/storage/folder/yvj2TAkVm.jpeg
case 2 : new upload in shared hosting works but not displaying image
http://website/storage/folder/Kw2ULsq.jpeg
The error is my Get http://website/storage/folder/Kw2ULsq.jpeg not found (404) Case 2 and case 1 folder, path is same. but they give me diff results
im using this to get my image
src="/storage/{{$data}}"
and on my routes im using this
Route::get('storage/{filename}', function ($filename)
{
$path = storage_path ('app/public' . $filename);
if(!File::exists($path)) abort(404);
$file = File::get($path);
$type = File::mimeType($path);
$response = Response::make($file, 200);
$response->header("Content-Type", $type);
return $response;
})->name('image/');
Can you help me ? Im at loss, ask me for something that can help you point my mistake is. Thanks very much
Please or to participate in this conversation.