【发布时间】:2013-01-30 14:33:07
【问题描述】:
如何下载文件并将其存储在本地?我已经搜索了文档和谷歌,但找不到它的示例。
我试过这个:
this.copyRemote = function(path,path2){
reader = Ti.Network.createHTTPClient();
writer = Ti.Filesystem.getFile(path2);
reader.open('GET',path);
reader.receive(writer);
}
但 Tidesdk 在尝试下载文件时崩溃,控制台上的最后一条消息是:
[12:42:39:647] [Ti.Network.HTTPClient] [Debug] Changing readyState from 0 to 1 for url:https://buttonpublish.com/api/images/7/image257189x142.jpg
[12:42:39:671] [Ti.Proxy] [Debug] Looking up proxy information for: https://buttonpublish.com/api/images/7/image257189x142.jpg
[12:
【问题讨论】:
-
您能否尝试使用 XMLHTTPRequest 来完成 http 部分。
标签: tidesdk