As an AJAX enthusiast, I often check several web2.0 and AJAX related blogs daily to get the latest scoop on projects, technologies, and innovations.  One of the best AJAX focused blogs is the popular ajaxian.com site.  Today, Dion Almaer published an article about the recently released project entitled "SWFUpload".  Of course this immediately caught my attention.  One of the best features of this script is the ability to degrade to a standard HTML upload form when Flash or JavaScript is not present or enabled in the browser, making this script highly usable and accessible.  According to their web site, SWFUpload has several very nice features, including:

  • Only display chosen filetypes in dialog
  • Upload multiple files at once by ctrl/shift-selecting in dialog
  • Trigger javascript functions on start, cancel, progress and complete
  • Get file information/size before upload starts
  • Style upload buttons any way you want
  • Do progress-bars/information using valid XHTML and CSS
  • No page reloads, display uploaded files as they are finished
  • Works on all platforms/browsers that has Flash support.
  • Degrades gracefully to a normal html upload form if Flash or javascript isn’t available

    The script is extremely easy to implement:

?View Code COLDFUSION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<script type="text/javascript">
	mmSWFUpload.init({
		upload_backend : "../../upload.php",
		button_image : "images/custom_button.png",
		button_mouseover_image : "images/custom_button_over.png",
		width : "258px",
		height : "82px",
		target : "SWFUpload",
		allowed_filetypes : "*.gif;*.jpg;*.png",
		upload_start_callback : 'uploadStart',
		upload_progress_callback : 'uploadProgress',
		upload_complete_callback : 'uploadComplete',
		upload_error_callback : 'uploadError',
		upload_cancel_callback : 'uploadCancel'
	});
</script>

    However, as a ColdFusion programmer, the ability to perform file uploads via Flash is nothing new.  The power of ColdFusion MX 7 is AMAZING!  If you are running an older version of ColdFusion, or you are not familiar with ColdFusion, I recommend you look into the broad expansion of features and simplicity that ColdFusion MX 7 has.  Here are a couple of articles that show you the power of CF 7:

    These are just a few recent articles that can shine light on the power of CF MX 7, and will perhaps convince you to consider ColdFusion MX 7 has your server-side scripting language or to upgrade your existing ColdFusion installation from a previous version.
    I don’t just want to talk about ColdFusion MX 7 here though, what I really want to accomplish is showing you the power of the <CFFORM> tag provided in ColdFusion MX 7.  The CFFORM tag has been expanding in CF 7 to include not just HTML forms, but also XML and Flash forms.  Although we will not discuss the XML forms here, it provides the ability to generate XForms-compliant XML and applies an XSL skin the form as defined.  More information about XForms, their benefits and drawbacks and compatibility issues can be viewed on the W3C Forms Working Group web site.  The real advantage of the CFFORM tag that is relevant here is the ability to generate Flash forms in which all form elements and components are generated and outputted to the browser in Flash!  Built upon Flex technologies, Flash forms provide a wide array of possibilities to ColdFusion developers to create next-generation RIAs.
    If you are interested in the power of combing Flash technologies with ColdFusion, the AsFusion web site is a must!  Not only focused on ColdFusion, but also ActionScript (the language powering Flash - kinda like JavaScript), this web site provides numerous examples that showcase the power of CF+Flash.  The article on File Uploads shows how ColdFusion developers can develop interactive File Upload forms using Flash through the CFFORM tag, although, keep in mind that this ability is limited to Flash Player 8 and higher.  Check out their postings and examples on Flash File uploads using ColdFusion:

    In conclusion, yes, I think that the SWFUpload script is an excellent contribution to the development of RIAs, but lets not forget, ColdFusion has had this ability for quite some time (and as always, CF makes it very simple!)

This entry was posted on Thursday, November 16th, 2006 at 3:09 pm.
Categories: Uncategorized.

No Comments, Comment or Ping

Reply to “Flash file uploads”