http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?hre f=00002210.html
download (FileReference.download method)
public download(url:String, [defaultFileName:String]) : Boolean
Displays a dialog box in which the user can download a file from a remote
server. Flash Player can download files of up to 100 MB.
This method first opens an operating-system dialog box that asks the user to
enter a filename and select a location on the local computer to save the file.
When the user selects a location and confirms the download operation (for
example, by clicking Save), the download from the remote server begins.
Listeners receive events to indicate the progress, success, or failure of the
download. To ascertain the status of the dialog box and the download operation
after calling download(), your ActionScript code must listen for events by
using event listeners such as onCancel, onOpen, onProgress, and onComplete.
When the file has successfully downloaded, the properties of the FileReference
object are populated with the properties of the local file and the onComplete
listener is invoked.
Only one browse() or download() session can be performed at a time (because
only one dialog box can be displayed at a time).
This method supports downloading of any file type, with either HTTP or HTTPS.
You can also send data to the server with the download() call by appending
parameters to the URL, for the server script to parse.
Note: If your server requires user authentication, only SWF files that are
running in a browser--that is, using the browser plug-in or ActiveX
control--can provide a dialog box to prompt the user for a user name and
password for authentication, and only for downloads. For uploads using the
plug-in or ActiveX control, and for uploads and downloads using the stand-alone
or external player, the file transfer fails.
When using this method, consider the Flash Player security model:
* Not allowed if the calling SWF file is in an untrusted local sandbox.
* The default is to deny access between sandboxes. A website can enable
access to a resource by adding a cross-domain policy file.
For more information, see the following:
* "Understanding Security" in Learning ActionScript 2.0 in Flash
* The Flash Player 8 Security white paper at
http://www.macromedia.com/go/fp8_security * The Flash Player 8 Security-Related API white paper at
http://www.macromedia.com/go/fp8_security_apis Availability: ActionScript 1.0; Flash Player 8
Parameters
url:String - The URL of the file to download to the local computer. You can
send data to the server with the download() call by appending parameters to the
URL, for the server script to parse. For example:
http://www.myserver.com/picture.jpg?userID=jdoe On some browsers, URL strings are limited in length. Lengths greater than 256
characters may fail on some browsers or servers.
defaultFileName:String [optional] - The default filename displayed in the
dialog box, for the file to be downloaded. This string cannot contain the
following characters: / \ : * ? " < > | %
If you omit this parameter, the filename of the remote URL is parsed out and
used as the default.
Returns
Boolean - A value of true if the dialog box in which a user can select a file
is displayed. If the dialog box is not displayed, the method returns false. The
dialog box could fail to be displayed for any of the following reasons:
* You did not pass a value for the url parameter.
* The parameters passed are of the incorrect type or format.
* The url parameter has a length of 0.
* A security violation occurred; that is, your SWF file attempted to
access a file from a server that is outside your SWF file's security sandbox.
* Another browse session is already in progress. A browse session can be
started by FileReference.browse(), FileReferenceList.browse(), or
FileReference.download().
* The protocol is not HTTP or HTTPS.