I’m accessing an image with this :
http://MyServerIP/storage/motorcycle/Image.jpg
if the image is already inside the project directory before XAMPP installed, it works!
C:xampphtdocsm2mobileapp-backendstorageapppublicmotorcycle
But when the image is uploaded from my Flutter app via Laravel to save it locally to my server after installing XAMPP, the uploaded image can not be accessed it’s always ended with 404 | Not Found Laravel page.
I’ve make sure that the image directory, image name & extension, and the URL is all correct.
and that newly uploaded image is really exist on my server folder :
C:xampphtdocsm2mobileapp-backendstorageapppublicmotorcycle
that newly uploaded image can be accessed if i’m reinstalling XAMPP.
But it’s different when i’m using my local IP PC address the newly uploaded file can be accessed right away after i uploaded it.
do u guys know why? i’m sorry i’m still new my words might be wrong but i hope u guys understand my English.
Thankyou!
2
Answers
I've found the solution, i'm uninstalling XAMPP and switching to Laragon.
If u're facing issues with Laragon about "QueryException, could not find driver"
U can follow these steps below :
Laravel’s storage:link command creates a symbolic link from the public/storage directory to the storage/app/public directory. This is often used to make files in the storage/app/public directory accessible from the web.
Here are some steps you can take to troubleshoot and potentially solve the issue:
Create Symbolic Link:
Ensure that the symbolic link from public/storage to storage/app/public is created. Run the following command in your Laravel project root directory:
php artisan storage:link
This command should create a symbolic link in the public directory named storage, pointing to storage/app/public.
Check File Permissions:
Ensure that the storage and public/storage directories have the correct permissions for the web server to read files. You can set the permissions using:
chmod -R 775 storage