Skip to content

ie8上传文件后提示下载文件 #27

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
youngwind opened this issue Feb 27, 2016 · 0 comments
Open

ie8上传文件后提示下载文件 #27

youngwind opened this issue Feb 27, 2016 · 0 comments

Comments

@youngwind
Copy link
Owner

问题

最近在做的项目需要兼容ie8,所以碰到不少兼容性问题。比如这个:在文件上传之后,会提示下载文件。

情况

后来google了一下才发现,在IE10及以下都会存在这个问题:上传文件成功后倘若服务器返回json数据,那么ie就不能正确解析这个数据,反而会把它当做文件来处理。

解决办法

在后端返回的时候自定义contype-type为"text/html",比如在node中这样写

res.setHeader('Content-Type', 'text/html');

参考资料:
http://www.oschina.net/question/223750_123703?fromerr=EtJSFnNr

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant