User Guide
Loading embedded content from SWF files imported into a security domain 479
Uploading and downloading files
The FileReference.upload() method starts the upload of a file selected by a user to a
remote server. You must call the
FileReference.browse() or
FileReferenceList.browse() method before calling the FileReference.upload()
method.
Calling the
FileReference.download() method opens a dialog box in which the user can
download a file from a remote server.
Uploads and downloads are not allowed if the calling SWF file is in the local-with-filesystem
sandbox.
By default, a SWF file may not initiate an upload to, or a download from, a server other than
its own. A SWF file may upload to, or download from, a different server if that server provides
a cross-domain policy file that grants permission to the domain of the invoking SWF file.
Loading embedded content from SWF
files imported into a security domain
When you load a SWF file, you can set the context parameter of the load() method of the
Loader object that is used to load the file. This parameter takes a LoaderContext object.
When you set the
securityDomain property of this LoaderContext object to
Security.currentDomain, Flash Player checks for a cross-domain policy file on the server of
the loaded SWF file. If there is a cross-domain policy file, and it grants access to the domain
of the loading SWF file, you can load the SWF file as imported media. In this way, the
loading file can get access to objects in the library of the SWF file.
NOTE
If your server requires user authentication, only SWF files 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. Flash
Player does not allow uploads to a server that requires user authentication.