【发布时间】:2019-08-29 02:04:00
【问题描述】:
图像保存到响应中指定的数据库和文件路径。试图显示图像或下载它,它不是显示的。我试图阅读相同的图像,但它正在工作。
storage_path('app/uploads/images/3.png')
我读取了存储在目录中的 3.png,它可以正常工作而不会显示错误,但要显示它不显示图像的图像。
[![if (empty($imag)){
return response()->json(\[
'success' => false,
'message' => 'There was a problem creating the postcard!'
\], 201);
}
return response()->json(\[
'success' => true,
'data' => file_get_contents(storage_path('app/public/uploads/images/'.$exportName)),
'message' => 'Postcard created successfully!'
\],200);
}
图片保存的目录是storage/app/public/uploads/ 我使用了 php artisan storage:link
【问题讨论】: