Open XinYiWorld opened 8 years ago
Do you solve the problem? I also meet the problem. I find the function define in source code as follow:
FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) {
argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments);
var self = this;
var subscription;
var basicAuthHeader = getBasicAuthHeader(source);
if (basicAuthHeader) {
source = source.replace(getUrlCredentials(source) + '@', '');
options = options || {};
options.headers = options.headers || {};
options.headers[basicAuthHeader.name] = basicAuthHeader.value;
}
var headers = null;
if (options) {
headers = options.headers || null;
}
if (false && headers) {
headers = convertHeadersToArray(headers);
}
var win = successCallback && function(result) {
subscription && subscription.remove();
successCallback(result);
};
var fail = errorCallback && function(e) {
subscription && subscription.remove();
var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body, e.exception);
errorCallback(error);
};
if (this.onprogress) {
subscription = EventEmitter.addListener('DownloadProgress-' + this._id, function(result){
self.onprogress(newProgressEvent(result));
});
}
exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id, headers]);
};
@XinYiWorld Are you solved this issue.?
when execute the mehtod exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]); in download,the error happens.