Comments (7)
用receiveDownloadStatus(),不管是否下载, 都能收到状态。
from rxdownload.
现在还没有批量添加下载任务和查询多个下载状态的方法, 后续会逐渐完善和增加。
最近工作比较忙,更新比较慢, 请谅解。
from rxdownload.
自动获取服务器的文件名之前考虑过, 根据响应头的ContentDisposition字段来获取文件名, 但是这样会多增加一次网络请求,权衡了一下觉得并不值得这么做。
from rxdownload.
判断文件名的操作, 上层自己处理就可以(如果不指定文件名, 则查询ContentDisposition
; 如果ContentDisposition也没查到, 则使用url; 如果url不便做为文件名, 则采用其对应的md5, 等等).
我在我司的项目中, 其实也涉及到这个问题. 因为项目工期的问题, 我只是简单的做如上所述的判断.
不过, 当时其实是有过如下的考虑的, 但这个到后面再来补充:
(1)如果有指定文件名, 则直接将url和文件名保存到mDownloadRecord
; 如果没有指定文件名, 则只将url保存到mDownloadRecord
中.
(2)然后发起一个查询请求(查询是否支持range/是否有指定文件名等). 如果没有指定文件名的话, 则从ContentDisposition
来读取文件名等得到一个文件名的操作, 然后填入mDownloadRecord
集合中 . 后面再来进行对下载文件是否已存在/是否支持range等的判断之类的操作.
这样做的话, 就不需要再额外增加一个网络请求.
from rxdownload.
@caixingke 恩,等忙完这段时间,好好重新思考一下。
from rxdownload.
3q
from rxdownload.
新版本修复了这几个问题,具体请看文档及代码🙂
from rxdownload.
Related Issues (20)
- Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. HOT 2
- Provide better Error messages
- 下载异常stream was reset: PROTOCOL_ERROR HOT 1
- How to sort list by it's download time? HOT 1
- How to delete single item from recorder database ?
- 大佬什么时候能升级rxjava3.0 HOT 1
- download keep suspending on download multiple files. HOT 1
- 配置文件都是同一个URL,所以每次不管有没有更新都识别为同一个文件,有办法关闭这个缓存吗? HOT 3
- 有时候会出现:FATAL EXCEPTION: RxCachedThreadScheduler-3 HOT 3
- Downloading files bigger than 15 mb doesn't seem to work on lower-end devices HOT 3
- UndeliverableException due to SocketException when cancel the download
- how to restart a download task with the same url after delete it
- It always timeout when I download AWS CDN resources with RxDownload4 HOT 4
- how to change request in rxdownload HOT 2
- download a large file with slow internet connection (for example GPRS) returns TimeoutException HOT 2
- 频繁点击清空缓存、下载出现崩溃,报错Fatal signal 7 (SIGBUS), code 2 (BUS_ADRERR) HOT 2
- 最大下载数限制设置未生效? HOT 7
- 删除后没有删除记录
- rxjava java.io.IOException: File name too long HOT 2
- 请问怎么修改 才能支持https 请求 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxdownload.