Failed to initialize data from binary data
2 answers
If your code works well on your localhost and you are uploading it to a running server and you encounter an error like this, sometimes it is caused by a path problem on Windows Server and Ubuntu / etc.
In my case, I changed everything \
in my path to/
I.e:
Image::make(base64_decode($request['profile_pic']))->save(public_path('cdn\profile_pictures\/'.$imageName))->destroy();
from
before
Image::make(base64_decode($request['profile_pic']))->save(public_path('cdn/profile_pictures//'.$imageName))->destroy();
Hope this helps someone ... Happy coding ...
0
source to share