Downloadify: Client-Side File Generation

Downloadify is a tiny JavaScript + Flash library that enables the generation and saving of files on the fly, in the browser, without server interaction.

Fork me on GitHub

Overview

Web applications that allow you to generate vCards, color palettes, custom code, etc would benefit from using this library. In addition to increasing speed (no round trip to the server) this solution can reduce the database and server load of existing web applications. This is not a library to ‘force download’ a file from a server. It does not interact with a server at all.

DemoDownload

How it works

Flash 10 introduced the ability to generate files on the client-side and trigger a save to the user’s computer. As Flash 10 has been gaining broad use and is now past a 93% install base, it’s time to make broad use of this feature! There is one catch: the user must click something in the Flash file to trigger the download for security reasons. Downloadify couples JavaScript callbacks with the Downloadify.swf to allow your code to respond to the click event and pass in your data at that time. Whatever data is passed in from your function will be saved to their hard-drive when and where they select.

Features
  • Super small: ~3KB of JavaScript, ~3KB SWF, ~2KB Image
  • Enables the creation and download of files without requiring server interaction.
  • Enables faster downloads when repurposing data already contained in a page. (vCard, iCal, etc)
  • Only requires swfobject. No other JavaScript library or framework is required for use.
  • jQuery plugin helper included in code.
  • NEW:MooTools plugin helper included in code.
  • Normal, Hover, and Down states on the download image.
  • NEW:Supports decoding and saving base64 encoded data
  • Open Source under the MIT License
Documentation

Documentation currently consists of a pretty detailed Read Me file on Github. I plan on getting the Wiki going over on Github as well, but for now the Read Me will have to suffice.

Change Log
  • Version 0.2:
    • Added support for base64 via the as3base64 Library
    • Added dataType option
    • Added MooTools helper (Thanks to David Walsh!)
    • Upgraded SWFObject to v2.2
  • Original Release: Version 0.1
Watch a 30 Second Overview:

Special thanks and huge kudos to Timothy B. Smith for the voice-over and audio production.


Real Life Use: Starter for jQuery

Starter for jQuery
Starter for jQuery
used to be a server/client side application. The settings were submitted back to the server before the code was generated or a download was created. With Downloadify, Starter is now a completely client-side app requiring only the initial page load before use. After that, any number of plugin skeletons can be created without touching the server once.