Angularjs 在html5中使用FileReaderService时获取上载文件的文件类型
我正在尝试检测上载文档的文件类型。为此,我创建了一个“FileReaderService”实例。我正在做这样的事情: var reader=FileReaderService.createReaderInstance(), fileData=angular.copy(新文件) 这对于pdf和图像来说效果不错,但对于docx、sheet和pptx来说效果更好。这不好用Angularjs 在html5中使用FileReaderService时获取上载文件的文件类型,angularjs,html,angularjs-scope,Angularjs,Html,Angularjs Scope,我正在尝试检测上载文档的文件类型。为此,我创建了一个“FileReaderService”实例。我正在做这样的事情: var reader=FileReaderService.createReaderInstance(), fileData=angular.copy(新文件) 这对于pdf和图像来说效果不错,但对于docx、sheet和pptx来说效果更好。这不好用 请帮我解决这个问题。我已经解决了。在比较文件类型的地方,我犯了一个错误: 以前的doc在中使用,现在使用docx。 现在,docx
请帮我解决这个问题。我已经解决了。在比较文件类型的地方,我犯了一个错误: 以前的doc在中使用,现在使用docx。 现在,docx、pptx和样式的文件类型如下:
sheet: vnd.openxmlformats-officedocument.spreadsheetml.sheet
docx: vnd.openxmlformats-officedocument.wordprocessingml.document
pptx: vnd.openxmlformats-officedocument.presentationml.presentation
你能做console.log(fileData)并粘贴它吗。这将有助于解决您的问题issue@Shantanu谢谢你的回复,但我已经解决了这个问题,并将答案发回
sheet: vnd.openxmlformats-officedocument.spreadsheetml.sheet
docx: vnd.openxmlformats-officedocument.wordprocessingml.document
pptx: vnd.openxmlformats-officedocument.presentationml.presentation