MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 646

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

About FileReference API functionality and security
Flash Player and the FileReference API (see
on page
644) support file uploading and downloading up to 100 MB. The FileReference API
does not let the Flash application that initiates the file transfer do the following:
Access the uploaded or downloaded file
Access the path of the file on the user's computer
When a server requires authentication, the only potentially successful operation is to perform
file downloading using the Flash Player browser plug-in. Uploading on all Flash players, or
downloading through the stand-alone or external Flash Player, fails on a server that requires
authentication. Use FileReference event listeners to determine whether operations completed
successfully or to handle errors.
Both file uploading and downloading are restricted to the SWF file's domain, including any
domains that you specify using a cross-domain policy file. You need to put a policy file on the
server if the SWF file that initiates the uploading or downloading doesn't come from the same
domain as the server. For more information on cross-domain policy files and security, see
"About domains, cross-domain security, and SWF files" on page
When calls to
FileReference.browse()
FileReference.download()
platforms: Mac OS X Flash Player browser plug-ins, the Macintosh external Flash Player, and
the Macintosh stand-alone player on Mac OS X 10.1 and earlier. The SWF file continues to
run on all Windows players and in the Macintosh stand-alone Flash Player on Mac OS X 10.2
and later.
When allowing users to upload files to a server, you should always be careful to check
the file type before saving the file to the hard disk. For example, you wouldn't want to
allow a user to upload a server-side script that could be used to delete folders or files on
the server. If you only want to allow users to upload an image file, make sure the server-
side script that uploads the files checks that the file being uploaded is a valid image.
For an example of an application that uses the FileReference API, see
functionality to an application" on page
Adding file upload functionality to an application
The following procedure shows you how to build an application that lets you upload image
files to a server. The application lets users select an image on their hard disks to upload and
then send it to a server. The image that they upload then appears in the SWF file that they
used to upload the image.
646
Working with External Data
"About file uploading and downloading"
,
FileReferenceList.browse()
are executing, playback of the SWF file pauses on the following
646.
694.
, or
"Adding file upload

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents