开发者

Flex : save a resource from url to hard drive?

How do I save a resource like "someth开发者_开发技巧ing.rar" from the web, like when it is located on a regular web page?


use FileReference.download(). There is a complete example shown at the adobe doc page.

Here's the basic idea:

var downloadURL:URLRequest = new URLRequest("http://www.[yourDomain].com/SomeFile.pdf");
var file:FileReference = new FileReference();

// add listeners to `file` to catch errors, handle progress, etc
// (see adobe docs for a complete example of the possible listeners)

file.download(downloadURL, fileName);


You're looking for the FileReference class. Here's a tutorial.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜