Where to save the images? I tried to save them in the storage/app under images folder (which is work fine)
public function fileUpload(Request $request) { if ($request->hasFile('image')) { $image = $request->file('image'); $name = time().'.'.$image->getClientOriginalExtension(); $destinationPath = storage_path('/app/images'); $image->move($destinationPath, $name); return response()->json(['data'=>"image is uploaded"]); }
}
and make a symbolic link to this folder in the public folder but its not working due to access permission error which will lead to the other issue.
What permission should i gave to the storage folder to make the whole operation works save the images and the saved link is readable (even 777 didn't work) Access forbidden!
sudo chmod -R 777 storage
非常感谢您提供的任何想法
755
吗? - freelancerchmod -R 0777 storage
(注意 0777)。还可以尝试php artisan storage:link
。 - Tpojka