{"id":13802883,"url":"https://github.com/dcneiner/Downloadify","last_synced_at":"2025-05-13T13:33:14.019Z","repository":{"id":718701,"uuid":"365830","full_name":"dcneiner/Downloadify","owner":"dcneiner","description":"A tiny javascript + Flash library that enables the creation and download of text files without server interaction.","archived":true,"fork":false,"pushed_at":"2010-01-23T23:20:32.000Z","size":138,"stargazers_count":844,"open_issues_count":1,"forks_count":194,"subscribers_count":42,"default_branch":"master","last_synced_at":"2024-10-21T03:13:00.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcneiner.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-11-09T02:34:06.000Z","updated_at":"2024-06-30T00:29:43.000Z","dependencies_parsed_at":"2022-07-07T15:08:24.839Z","dependency_job_id":null,"html_url":"https://github.com/dcneiner/Downloadify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcneiner%2FDownloadify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcneiner%2FDownloadify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcneiner%2FDownloadify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcneiner%2FDownloadify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcneiner","download_url":"https://codeload.github.com/dcneiner/Downloadify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225229921,"owners_count":17441345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:02:02.820Z","updated_at":"2024-11-18T18:30:46.431Z","avatar_url":"https://github.com/dcneiner.png","language":"JavaScript","readme":"h2. Downloadify: Client Side File Creation\n\n*_Important! The swf has been compiled for online use only. Testing from the file path (i.e. file:// ) will not work as it will violate the security sandbox._*\n\nh3. Overview\n\nThis library is a tiny JavaScript + Flash library that allows you to generate files on the fly, in the browser, without server interaction. 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._\n\nh3. Demo\n\nA \"very simple demo is available\":http://pixelgraphics.us/downloadify/test.html that lets you supply your own content and filename and test out saving, canceling, and the error functionality when the file is blank.\n\nFor a real world usage, see \"Starter for jQuery\":http://starter.pixelgraphics.us . To quickly demo the usage, just click \"Load Example Data\" then click Download. After the initial page load, no further contact is made with the server. Everything happens on the client side.\n\nh3. Download\n\nPlease download from the \"Downloads\":http://github.com/dcneiner/Downloadify/downloads section of this project.\n\nh3. Support\n\nFor support, please use the \"Issues\":http://github.com/dcneiner/Downloadify/issues section of this project. You can also try to hit me up on \"Twitter at @dougneiner\":http://twitter.com/dougneiner but I might just ask you to file an issue. :)\n\nh3. Dependencies\n\n_The end user must have Flash 10 or higher installed for this plugin to work. As of September 2009, it was at a 93% saturation, so most users should already have it installed._\n\nDownloadify is only dependent on \"SWFObject 2.0\":http://code.google.com/p/swfobject/ which is included with the download. It is compatible with any JavaScript framework but has a helper for both jQuery and MooTools. Neither helper will be activatd if Downloadify is inserted prior to including the framework library.\n\nh3. Usage\n\n*Any JavaScript framework*:\n\n\u003cpre\u003eDownloadify.create( id_or_DOM_element, options );\u003c/pre\u003e\n\n*jQuery*:\n\n\u003cpre\u003e$(\"#element\").downloadify( options );\u003c/pre\u003e\n  \n*MooTools:*\n\n\u003cpre\u003e$(\"elementid\").downloadify( options );\u003c/pre\u003e\n\nh3. Options\n\nUnless you are using the jQuery plugin included with Downloadify, you must supply all required options with your call to the \u003ctt\u003eDownloadify.create\u003c/tt\u003e function.\n\n*Defaults and Required Options*\n\n* \u003ctt\u003eswf\u003c/tt\u003e: \u003ctt\u003e'media/downloadify.swf'\u003c/tt\u003e \u003cspan style=\"color:red\"\u003e*Required*\u003c/span\u003e \u003cbr /\u003e_Path to the SWF File. Can be relative from the page, or an absolute path._\n* \u003ctt\u003edownloadImage\u003c/tt\u003e: \u003ctt\u003e'images/download.png'\u003c/tt\u003e \u003cspan style=\"color:red\"\u003e*Required*\u003c/span\u003e \u003cbr /\u003e_Path to the Button Image. Can be relative from the page or an absolute path._\n* \u003ctt\u003ewidth\u003c/tt\u003e: 175 \u003cspan style=\"color:red\"\u003e*Required*\u003c/span\u003e \u003cbr /\u003e_Width of the button (and the flash movie)_\n* \u003ctt\u003eheight\u003c/tt\u003e: 55 \u003cspan style=\"color:red\"\u003e*Required*\u003c/span\u003e \u003cbr /\u003e_Height of the button. This will be 1/4 the height of the image._\n* \u003ctt\u003efilename\u003c/tt\u003e: \u003cspan style=\"color:red\"\u003e*Required*\u003c/span\u003e\u003cbr /\u003e _Can be a String or a function callback. If a function, the return value of the function will be used as the filename._\n* \u003ctt\u003edata\u003c/tt\u003e: \u003cspan style=\"color:red\"\u003e*Required*\u003c/span\u003e\u003cbr /\u003e _Can be a normal String, base64 encoded String, or a function callback. If a function, the return value of the function will be used as the file data._\n* \u003ctt\u003edataType\u003c/tt\u003e: \u003ctt\u003e'string'\u003c/tt\u003e\u003cbr /\u003e _Must be a String with the value \u003ctt\u003estring\u003c/tt\u003e or \u003ctt\u003ebase64\u003c/tt\u003e. Data paired with the \u003ctt\u003edataType\u003c/tt\u003e of \u003ctt\u003ebase64\u003c/tt\u003e will be decoded into a \u003ctt\u003eByteArray\u003c/tt\u003e prior to saving._\n* \u003ctt\u003etransparent\u003c/tt\u003e: false \u003cbr /\u003e_Set this to true to use wmode=transparent on the flash movie._\n* \u003ctt\u003eappend\u003c/tt\u003e: false \u003cbr /\u003e_By default the contents of the targeted DOM element are removed. Set this to true to keep the contents and append the button._\n\n*Event Callbacks*\n\nNo data is passed into these functions, they are simply called.\n\n* \u003ctt\u003eonError\u003c/tt\u003e: _Called when the Download button is clicked but your \u003ctt\u003edata\u003c/tt\u003e callback returns \u003ctt\u003e\"\"\u003c/tt\u003e._\n* \u003ctt\u003eonCancel\u003c/tt\u003e: _Called when the Download button is clicked but the user then cancels without saving._\n* \u003ctt\u003eonComplete\u003c/tt\u003e: _Called when the Download button is clicked and the file is saved to the user's computer._\n\nh3. Setting Up the Image\n\nDownloadify supports (i.e. requires) three button states with limited support for a fourth. The states are:\n\n* *Normal*\n* *Over* ( When the mouse hovers over the button )\n* *Down* ( When the button is pressed )\n* *Disabled* ( Limited support, when .disable() is called on the Downloadify.Container object )\n\nIn trying to keep this plugin as simple as possible, all four states are always assumed to be present. You should prepare your button image as a single image the width you want your button, and four times the height of the button. All four states should then live in that one image in the same order as the previous list from top to bottom.\n\nh3. Potential Issues\n\nWhen working with different button images, you may find Flash has cached your image. This is the desired behavior on a live site, but not during development. To get around this, simply supply a ?rev=1 or ?rev=2 etc on the end of your downloadImage url.\n\nh3. Compiling Notes\n\nI develop locally using Xcode and the Flex 4 SDK Beta 2. Please do not submit request on how to setup a local testing environment. If you are interested in my Xcode project files, send me a message. \n\nh3. Developers\n\n*Core Developer:* \"Doug Neiner\":http://dougneiner.com\n\n*Contributors:*\n\n* \"David Walsh\":http://davidwalsh.name -- Contributed the MooTools helper\n\nh3. Change Log\n\n* *Version 0.2*:\n** Added support for \u003ctt\u003ebase64\u003c/tt\u003e via the \"as3base64 Library\":http://github.com/spjwebster/as3base64\n** Added \u003ctt\u003edataType\u003c/tt\u003e option\n** Added MooTools helper (Thanks David!)\n** Upgraded SWFObject to v2.2\n* *Original Release:* Version 0.1\n\nh3. License Information: MIT\n\nas3base64: \"Copyright (c) 2006 Steve Webster\":http://github.com/spjwebster/as3base64\n\nAll Downloadify Code: Copyright (c) 2009 Douglas C. Neiner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","funding_links":[],"categories":["JavaScript","38. 下载组件"],"sub_categories":["24.3 Web Sockets"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcneiner%2FDownloadify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcneiner%2FDownloadify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcneiner%2FDownloadify/lists"}