Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File html5拖放返回错误的mime?_File_Html_Drag And Drop - Fatal编程技术网

File html5拖放返回错误的mime?

File html5拖放返回错误的mime?,file,html,drag-and-drop,File,Html,Drag And Drop,我有一个HTML5拖放文件上传程序,它可以完美地工作。但是,如果我将.txt文件更改为.jpg文件并将其上载,mime将变为image/jpeg,扩展名为.jpg 如何解决这个问题,我需要确保用户不会上传任何图像。我最终使用PHP检查JFIF、GIF89、PNG bom,然后使用它检查图像。这似乎是唯一可能的办法

我有一个HTML5拖放文件上传程序,它可以完美地工作。但是,如果我将.txt文件更改为.jpg文件并将其上载,mime将变为image/jpeg,扩展名为.jpg


如何解决这个问题,我需要确保用户不会上传任何图像。

我最终使用PHP检查JFIF、GIF89、PNG bom,然后使用它检查图像。这似乎是唯一可能的办法