Tuesday, March 20, 2018

I have an issue on retrieve the image from the storage folder in Lumen API - development

I have an issue on retrieve the image from the storage folder in Lumen API

I have an application written the API by using lumen and using front end as a Mobile app developed by using ionic3. I could take the picture and store into the server by the below code,

$image = $request->file('photo'); 
$name = $image->getClientOriginalName(); 
$destinationPath = storage_path('/app/images/kyc'); 
if($image->move($destinationPath, $name)){ 
    //Success the file upload means storing the file name into DB table 
} // This work and storing my image into storage/app/public 

Now I need to retrieve this profile picture to the mobile app and need to display image. I have tried like http://example.com/storage/app/public /profile/filename.png but it didn’t work and showing like

{"error":true,"message":"Unauthorized Request"}

Please help me anyone to fix this issue and showing the image in image tag.



from Laravel Questions and Answers https://laravelquestions.com/php/i-have-an-issue-on-retrieve-the-image-from-the-storage-folder-in-lumen-api/
via Lzo Media

No comments:

Post a Comment