Reputation: 2604
How do I save a resource like "something.rar" from the web, like when it is located on a regular web page?
Upvotes: 1
Views: 142
Reputation: 13542
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);
Upvotes: 3
Reputation: 81988
You're looking for the FileReference class. Here's a tutorial.
Upvotes: 2