Monthly Archives: September 2007

Uploading files in Flex using the FileReference class

In an earlier example we looked at “Downloading files in Flex using the FileReference class“, but It looks like we haven’t ever looked at file uploads.
The following example shows how you can use the FileReference class’s browse() method to allow users to select and upload a single file to a Web server.

If you want to allow users to upload multiple files at once, you would use the FileReferenceList class instead of FileReference.

Full code after the jump.

Continue reading

Determining a Flex application’s current security sandbox type

The following example shows how you can determine the current security sandbox type for a Flex application by checking the static, read-only Security.sandboxType property. You can also check for specific sandbox types by comparing the sandboxType property to the static constants in the Security class (LOCAL_TRUSTED, LOCAL_WITH_FILE, LOCAL_WITH_NETWORK, and REMOTE).

Full code after the jump.

Continue reading