Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
3.7.0
-
None
-
org.apache.cordova.file-transfer 0.4.7 "File Transfer"
Description
According to documentation "download" action parameters are as follows (optional ones are marked [as such]):
- source
- target
- [trustAllHosts]
- [options]
https://github.com/apache/cordova-plugin-file-transfer/blob/master/doc/index.md#download
In iOS implementation the parameters are different:
- source
- target
- [trustAllHosts]
- downloadId
- [headers]
https://github.com/IvanKarpan/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L366
I am no Android, Windows or WP developer but reading those platforms' implementations it seems like they all in fact require some sort of a download id at index 3.
All of this means that some of the plugin functionality cannot be used by users because they are misguided by documentation. It also means that there is a problem with arguments order, because "downloadId" is mandatory while "trustAllHosts" is not.
I will submit a pull request via github to update the documentation. If this is enough for the community we could leave it at that.
Otherwise it seems like how it should actually be done is as follows:
- source
- target
- download id
- [trustAllHosts]
- [headers]
I can/will easily do this for iOS and make necessary changes to the documentation although I will need some help to fix this/review my blindfolded fixes on other platforms.