【解决】axios 下载文件 Failed to read the 'responseText' property from 'XMLHttpRequest'

这篇具有很好参考价值的文章主要介绍了【解决】axios 下载文件 Failed to read the 'responseText' property from 'XMLHttpRequest'。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

主要解决以下两个问题

问题一:idm一些网站不允许请求同一文件两次

故障原因:IDM 在发神经

因为它检测到浏览器集成插件未安装,所以诱导你安装。实际上,装了插件问题也会出现。改参数都没用。

1.很可能是你点击网页的 下载链接 有问题(换个网页下载试试,就不提示了),Edge 浏览器一直会欺骗你, Google 浏览器偶会欺骗你。⇒ 如果开发项目,检查后端接口正常

问题二:Uncaught DOMException: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'blob').
at r.onreadystatechange (http://cdn.staticfile.org/axios/0.1.0/axios.min.js:2:1004)

2.也可能是前端 请求工具 出了问题。比如请求工具

// post、put、patch 等请求
axios.post(url, {...someData}, {responseType: 'blob'})
    .then((res) => {
        //...
    }).catch((err) => {
        //
    })

故障原因:排查一个早上,也参考了 Github 一些仓库的代码,在另一个项目也正常用的,这个语法没有问题。最后才发现,是 axios 版本太 TM 老了。

<!--<script src="//cdn.staticfile.org/axios/0.1.0/axios.min.js"></script>-->
<script src="//cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.min.js"></script>

更新到 1.3.6 ,网页点击下载,就正常了。IDM也不报错。
文章来源地址https://www.toymoban.com/news/detail-428115.html

到了这里,关于【解决】axios 下载文件 Failed to read the 'responseText' property from 'XMLHttpRequest'的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 开机自启失败读串口失败 read failed: device reports readiness to read but returned no data解决

       最近在开始接触树莓派,想要完成的功能是在树莓派上跑一个Python程序获取树莓派串口的数据,然后将Python程序配置为开机自启,让其上电之后就自动开始获取串口数据并上传数据到云端(我用的是MQTT服务器,如果有需要了解这部分内容小伙伴留言,我再抽时间把这部

    2023年04月26日
    浏览(25)
  • Unity报错:InvalidOperationException:You are tring to read lnput using the UnityEngine. ……的解决办法

    问题描述: 我在运行steam VR的Interaction_Example时报错,其中unity为2021.3.6f1c1,steam VR(2.7.3),头显为HTC Vive pro2。报错具体内容如下: InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings. UnityEngine

    2024年02月12日
    浏览(36)
  • Xcode14:”Failed to prepare the device for development“解决

    当前Xcode版本14.2,测试机iOS版本16.4, 结果出现提示: Failed to prepare the device for development, 经过Clean,重装都无效,最后发现其他人也有类似的问题        https://developer.apple.com/forums/thread/714388 PS:首先把升级之前的arc文件复制出来,arc文件的目录如下 /Applications/Xcode.app/Content

    2024年02月08日
    浏览(27)
  • 【解决方法】各类软件启动报错:Failed to create the Java Virtual Machine

    工具:小锐云服 PRO ,Windows 命令处理器,Java 环境 系统版本:Windows 10 描述:不知名原因导致的 Java 虚拟机创建失败,百度良久后通过修改系统环境变量,完成了对问题的处理。 提示:若按照教程还是无法完成操作,可以进入右侧的企鹅,找我看看。 视频教程: 文字教程:

    2024年02月12日
    浏览(41)
  • Xcode真机运行报错:Failed to prepare the device for development解决方法

            运行Xcode然后打包APP,结果Xcode报错,如下: Failed to prepare the device for development. This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your Mac and device in order to correctly detect compatibility.         Xcode     Version 1

    2024年02月12日
    浏览(28)
  • 【你该安装新的Xcode了】【解决】Failed to prepare the device for development

    报错信息如下: Failed to prepare the device for development. This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode.You may also need to restart your Mac and device in order to correctly detect compatibility. 意思很明了,用最新版的Xcode吧。 实践证明:Xcode 14.0.1不能在iPa

    2024年02月15日
    浏览(43)
  • 【Git】解决fatal: unable to access..Failure when receiving data from the peer或者OpenSSL SSL_read: Connect

    今天拉取仓库的代码时,报错如下: 又或者 OpenSSL SSL_read: Connection was reset, errno 10054 再或者: 解决办法: 因为git在拉取或者提交项目时,中间会有git的http和https代理,但是我们本地环境本身就有SSL协议了,所以取消git的https代理即可,不行再取消http的代理。 第一种方式就是

    2024年02月04日
    浏览(45)
  • Flink CDC报The connector is trying to read binlog starting at xxx but this is no longer available问题解决

    问题是笔者最近在使用FlinkCDC 2.3.0 捕获MySQL binlog日志时遇到的,MySQL使用的阿里云的RDS, MysqlCDC 使用读账号以 Initinal 模式,任务已经运行了一段时间突然报的错,之前在使用FlinkCDC时也曾遇到过,设置了一些参数后没有再出现过,一直比较忙没有来得及总结下来。但是今天同

    2024年02月07日
    浏览(35)
  • Unity实战问题-解决UnityHUb的Failed to start the Unity Package Manager local server process

    点击跳转=Unity3D特效百例 点击跳转=案例项目实战源码 点击跳转=游戏脚本-辅助自动化 点击跳转=Android控件全解手册 点击跳转=Scratch编程案例 点击跳转=软考全系列 点击跳转=蓝桥系列 专注于 Android/Unity 和各种游戏开发技巧,以及 各种资源分享 (网站、工具、素材、源码、游

    2024年02月13日
    浏览(39)
  • S32K锁死之谜?Failed to download RAMCode? Failed to Read Memory?

    近期在做一个小产品,是基于S32K144为MCU的板子。在调试过程中发现,虽然采用Jlink可以连接上,但是无法用S32DS的Debug模式进行调试。也就是.elf文件无法下载进入FLASH,而错误提示总是如下: (1)Failed to download RAMCode (2)Failed to Read Memory xxx 而且让人崩溃的是焊接了10套板子

    2023年04月22日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包