Solve the problem that PHP cannot read the file type of the incoming blob object

Time:2020-10-18

Due to the needs of the project, the front-end uses JS to compress and upload the pictures. After the images are compressed by canvas, they are transferred to blob objects and uploaded. But the file type obtained by PHP is binary stream,application/octet-streamType. Try to transfer blob to file upload in the front end, but failed, and found a solution.
go php.ini Open PHP_ The extension of FileInfo is enough, and the extension of pagoda environment can be installed.Solve the problem that PHP cannot read the file type of the incoming blob object