• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Kevin Schmidt - Uploading Files in Flex
 

Kevin Schmidt - Uploading Files in Flex

on

  • 6,170 views

One of the many tasks that confuse beginning Flex developers is how to upload files into their application. Come find out how to upload files with Flex and how to process those files on the server ...

One of the many tasks that confuse beginning Flex developers is how to upload files into their application. Come find out how to upload files with Flex and how to process those files on the server side with ColdFusion.

Statistics

Views

Total Views
6,170
Views on SlideShare
6,131
Embed Views
39

Actions

Likes
0
Downloads
31
Comments
0

3 Embeds 39

http://www.slideshare.net 37
http://translate.googleusercontent.com 1
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Kevin Schmidt - Uploading Files in Flex Kevin Schmidt - Uploading Files in Flex Presentation Transcript

    • Uploading Files in Flex Kevin Schmidt Other Side Productions, LLC kevin.schmidt@othersidellc.com
    • Who am I? - Adobe Community Expert - Adobe Certified Instructor - Indianapolis Flex User Group Manager - Speaker at Adobe MAX - Blog – flexinabox.com - Founder – Other Side Productions, LLC - Flex Consulting - LiveCycle Consulting - ColdFusion Consulting
    • The Basics 1. Form - text field - browse button - upload button 2. Display a dialog box to allow the user to browse their local file system for a file to upload. 3. Upload the file to the server. 4. Process the file upload on the server. 5. Return any data necessary
    • FileReference Class - The FileReference class provides a means to upload and download files between a user's computer and a server. An operating-system dialog box prompts the user to select a file to upload or a location for download. - IT DOES NOT - Allow you to read from or write to the transferred file – no access to the file at all -Allow for authentication
    • Using The FileReference Class - Create a FileReference Object: var fileReference:FileReference = new FileReference(); -Notes - References one file - Populated with information about the file - Properties - name – The name of the file on the local system - size – The size, in bytes - type – The file type - creationDate – Date file created on local system - creator ( MAC Only ) - null on all other systems - modificationDate – Date file last modified on local system
    • FileReference.browse() Method - Opens the operating system dialog box to allow user to select a file. - User allowed to select a single file - Populates the properties of the FileReference object - Resets the properties each time the method is called - Usually invoked in response to a click event - Default location displayed in the dialog box is the most recently browsed location – default is the desktop if unknown location
    • FileReference.upload() Method -Uploads the file in the FileReference object -Requires two arguments - request – URLRequest object that points to the server side code to process the upload. - uploadDataFieldName – variable name used in the server side code. Default: Filedata - URLRequest var urlRequest = new URLRequest(“http://www.url.com/fileUpload.ext” )
    • FileReference.cancel() Method - Cancels the upload of the file currently uploading
    • Events - SELECT:Event – Dispatched when the user selects a file from the dialog box - PROGRESS:ProgressEvent - Dispatched when progress data is available - event.bytesLoaded – total loaded - event.bytesTotal – total to load - COMPLETE:Event – Dispatched when the file has completely uploaded. - UPLOAD_COMPLETE_DATA:DataEvent – Dispatched when the server responds with data. - IO_ERROR:IOErrorEvent – Dispatched when an error occurs during the upload
    • FileFilter Class Allows you to restrict the file extensions that users can select Supply to the FileReference.browse() method. var fileFilter:FileFilter = new FileFilter( “Images”, “*.jpeg;*.jpg”); fileReference.browse( [fileFilter] );
    • Example
    • Questions – Comments - Insults Email: kevin.schmidt@sporkconsulting.com Slides and Sample Code at: http://www.flexinabox.com