Implement the handleResumeDownload function to send a new request to the server with the appropriate Range header to request the remaining part of the file. Update the state to indicate that the download is no longer paused. const handleResumeDownload = (download) => { // Create a new Axios request with a Range header to resume the download // Update the state to mark it as no longer paused and update the progress };
5条答案
按热度按时间gtlvzcf81#
你能对问题更具体一些吗?添加一些描述,比如图片/视频。
guykilcj2#
假设我正在尝试并行下载文件f1、f2和f3。它运行正常,现在我使用中止选项暂停下载,它也能正常工作。现在当我想要尝试重新启动已暂停的下载时,我看不到任何选项。我的问题是:如果Axios不支持这个功能,那么在React.js中有没有其他方法可以实现?我正在使用React.js与Axios一起使用。在React.js中,我无法将文件分割成块并访问文件系统。
sc4hvdpw3#
这个问题与#5995相同。
cunj1qz14#
Implement the handleResumeDownload function to send a new request to the server with the appropriate Range header to request the remaining part of the file. Update the state to indicate that the download is no longer paused.
const handleResumeDownload = (download) => { // Create a new Axios request with a Range header to resume the download // Update the state to mark it as no longer paused and update the progress };
8gsdolmq5#
感谢@rahulbansod519,但我正在使用React.js和Axios,所以我无法访问fs模块来更新文件块。