使用AngularJS上传文件

使用AngularJS上传文件,第1张

使用AngularJS上传文件

这里的一些答案建议使用

FormData()
,但不幸的是,这是Internet Explorer
9及更低版本中不可用的浏览器对象。如果需要支持那些较旧的浏览器,则需要使用
<iframe>
或使用Flash 的备份策略。

已经有许多Angular.js模块可以执行文件上传。这两个对旧版浏览器有明确的支持:

  • https://github.com/leon/angular-upload-使用iframe作为后备广告
  • https://github.com/danialfarid/ng-file-upload-使用FileAPI / Flash作为后备

还有其他一些选择:

  • https://github.com/nervgh/angular-file-upload/
  • https://github.com/uor/angular-file
  • https://github.com/twilson63/ng上传
  • https://github.com/uploadcare/angular-uploadcare

其中之一应适合您的项目,或者可以使您对如何自己编写代码有所了解。



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5666498.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存