凌凌漆
凌凌漆
  • 发布:2015-04-09 11:21
  • 更新:2015-07-24 11:32
  • 阅读:3400

plus.downloader.createDownload的URL只支持静态文件、图片吗?

分类:HTML5+

以下代码,URL中如果跟了?参数,status输出始终是400

// 创建下载任务
function createDownload() {
var dtask = plus.downloader.createDownload( "http://www.abc.com/a.doc?para=1&stamp=2", {}, function ( d, status ) {
// 下载完成
if ( status == 200 ) {
alert( "Download success: " + d.filename );
} else {
alert( "Download failed: " + status );
}
});

2015-04-09 11:21 负责人:无 分享
已邀请:
chender

chender - 与人为善

可以跟参数吧,我这边都有带参数到后台

  • 凌凌漆 (作者)

    但我的代码执行后输出就是 status=400,直到今天还是困扰。

    2015-07-24 11:30

凌凌漆

凌凌漆 (作者)

请问您的代码是怎样写的?
能提供下例子吗?

以下是我的代码:
var url = "http://test.myserver.com/test.php?testID=123";
var options = {
method: "GET",
filename: "_doc/2015/",
retry: 0
};
var dtask = plus.downloader.createDownload(url, options, function(task, status) {
// 下载完成
if (status == 200) {
console.log("Download success: " + task.filename);
} else {
console.log("Download failed-----------------");
console.log("status: " + status);
}
});

凌凌漆

凌凌漆 (作者)

如果不带参数,就能正常,status=200

该问题目前已经被锁定, 无法添加新回复