Level 88
I have never seen this before. I also don't think that this is the way to handle your file uploads for an API.
Take a look at this: https://stackoverflow.com/questions/52801133/laravel-api-how-to-upload-file
i am creating api in which image is uploaded with fields Bio and Url to the databse using postman.when i try to retrieve the data it hit this error
InvalidArgumentException: Malformed UTF-8 characters, possibly incorrectly encoded in file
here is my show method
public function show($id) {
$image = Images::findOrFail($id);
$image_file = Image::make($image->user_image);
$response = Response::make($image_file->encode('jpeg'))->header('Content-Type', 'image/jpeg');
$image_bio=$image->Bio;
$image_url=$image->Url;
return Response::json(array(
'user_image' => $response,
'Bio' => $image_bio,
'Url' => $image_url,
));
}
Please or to participate in this conversation.