EzDevInfo.com

Downloadify

A tiny javascript + Flash library that enables the creation and download of text files without server interaction.

Using downloadify to download binary files

HTML5 has a convenient download attribute that allows the downloading of a file named foo.exe to be saved as a different name like bar.exe:

<a rel='nofollow' href="http://example.com/foo.exe" download="bar.exe">Download It</a>

However, support is limited to recent versions of Chrome and Firefox. I plan to use this for those browsers, but use Downloadify for various IE versions.

Most of the Downloadify examples that I've seen are regarding the saving of textual data from the client. Is it possible to use Downloadify with binary files from a known URL?


Source: (StackOverflow)

Change Downloadify button

I'm using Downloadify script in order to download pdf in IE9. I want to change Downloadify button image to another image.

How can I do it?

Thanks!


Source: (StackOverflow)

Advertisements

jsPDF using downloadify including an image not working

Here's the code:

Downloadify.create('downloadify',{
    filename: 'Example.pdf',
    data: function(){ 
        var doc = new jsPDF();
        doc.setFontSize(40);
        doc.text(35, 25, "Octonyan loves jsPDF");
        doc.addImage(imgData, 'JPEG', 15, 40, 180, 180);
        return doc.output();
    },
    onComplete: function(){ alert('Your File Has Been Saved!'); },
    onCancel: function(){ alert('You have cancelled the saving of this file.'); },
    onError: function(){ alert('Error'); },
    swf: 'Downloadify/media/downloadify.swf',
    downloadImage: 'Downloadify/images/save.png',
    width: 250,
    height: 40,
    transparent: true,
    append: false
});

Target browser is IE8. I'm using the image example from jsPDF.com. If I remove the doc.addImage line it works just fine. Ideas? Thanks.


Source: (StackOverflow)

Unable to see the "save to disk" button [closed]

I am trying to include downloadify javascript+flash plugin on my web page but somehow the "Save to disk" button is not visible.

Working demo :http://pixelgraphics.us/downloadify/test.html

my page: http://www.javaexperience.com/Feedback/index.html

can someone point me to what I could be missing


Source: (StackOverflow)

How to enable downloadify in jsPdf?

Hey I have added jsPdf into my HTML to download the HTML as a PDF, but in IE 9 it doesn't works. It is not downloading any PDF so I searched about this and got the I have to enable the IE shim for this so can you help me out that how I can be able to do that, I have tried to use Downloadify but didn't understand how to pass full HTML file and get the image of that into PDF.


Source: (StackOverflow)

Downlodify is not working, no error message at all

I have the latest shock wave (11.9.900.117) add-on installed to my Firefox (24).

When i download and run the sample test.html file nothing is happening.But when i run the same demo linked (http://pixelgraphics.us/downloadify/test.html) HTML from Git hub works as expected.

Also i have tried this with my project too, same kind of output, nothing happens but the button hides.There are no error messages shown or can be caught since i cant go through the swfobject.js file.

I am using javascript alone, not jquery etc.

Is there anything that i am missing some basic stuffs?

Also asked in https://github.com/dcneiner/Downloadify/issues/34. Any simple working examples would be helpfull.!!

Thanks in advance.


Source: (StackOverflow)

Downloadify with Angular

I'm using Downloadify lib to download a text file on the client side in my Angular app

This is my function:

    function loadFileSaver() {
        Downloadify.create('downloadify',{
            filename: function(){
                return document.getElementById('filename').value;
            },
            data: function(){ 
                return document.getElementById('data').value;
            },
            swf: 'downloadify.swf',
            downloadImage: 'download.png',
            width: 100,
            height: 30,
            transparent: true,
            append: false
        });
}

My problem is with the line downloadImage: 'download.png'. It is giving 403 (Forbidden) error.

Any idea on how to solve this ?


Source: (StackOverflow)

AngularJS Downloadify bind data

I am try to download a word document which I receive as a base64 string from my web services.

On my html page, I ask the user to enter some data to populate the word and when the user click on a button I would like to download the word document.

Button --> Send to web service --> Create word document --> Send back base64 --> Download this base64 as word document

I am using Downloadify to make this possible in IE9

The probleme is that Downloadify ask for the filename and data on the page load. I get those information only after the user enter the data on the same page.

Downloadify.create('downloadify', {
    filename: filename,
    data: data,
    onComplete: function () {
        alert('Your File Has Been Saved!');
    },
    onCancel: function () {
        alert('You have cancelled the saving of this file.');
    },
    onError: function () {
        alert('You must put something in the File Contents or there will be nothing to save!');
    },
    transparent: false,
    swf: 'js/lib/Downloadify/media/downloadify.swf',
    downloadImage: 'js/lib/Downloadify/images/download.png',
    width: 100,
    height: 30,
    transparent: true,
    append: false
});

Is there a way to bind the filename and data ? Or should I add another page which will already get all the data and will just ask for "Save on disk" ?


Source: (StackOverflow)

Bower install from URL gives blank folder

I'm using bower (v. 1.3.5) to pull in my Front-End JS dependencies, and I want to depend on this: https://github.com/dcneiner/Downloadify

It doesn't have its own bower.json so I'm referencing by URL in MY bower.json:

  "dependencies": {
    "jspdf": "~1.0.272",
    "downloadify": "https://github.com/dcneiner/Downloadify.git"
  }

But all I get is the named folder containing only a .bower.json file, but none of the code or anything else in the GH repo.

Running bower install directly on the cmd line gave (once I'd cleared out the bower cache):

E:/My/Path>bower install https://github.com/dcneiner/Downloadify.git
bower Downloadify#*        not-cached https://github.com/dcneiner/Downloadify.git#*
bower Downloadify#*        resolve https://github.com/dcneiner/Downloadify.git#*
bower Downloadify#*        checkout 0.2.1
bower Downloadify#*        resolved https://github.com/dcneiner/Downloadify.git#0.2.1
bower Downloadify#~0.2.1   install Downloadify#0.2.1

I previously did the same thing with jQuery.fileDownload which worked perfectly, so I don't think it's anything I've done to my machine?

QUESTION:

  • Have I done something wrong?
  • Has Downloadify been set up wrong?
  • Or is it an inexplicable mystery?

In either of the first 2 cases, what is the problem and how do I fix it?

NOTE: Currently I'm working around it by having downloaded the source code manually and having it hard-coded into my project.


Source: (StackOverflow)

Fire several flash buttons on a single click

I'm using Zero Clipboard and Downloadify to put certain data into clipboard and call Save As dialog. I want to avoid having to click two buttons, but Flash does not allow taking action with simulated click() from Javascript, only real mouseclicks. Is there a way to "spread" a single click done by user to two flash buttons?

I think I heard somewhere that a click can reach through several layers of elements. I tried putting the two buttons one on top of another (by calling ZClip on the flash object that Downloadify generates), but it doesn't work, only the upper button fires (ZClip), even though the bottom one is able to detect mouseover (changes button color).

I need this for a userscript I'm writing for myself to enhance functionality of an online photoalbum. The idea behind the script is that it tries to guess the category of a currently opened image based on its filename or tags and generates a full path under which I would want to save this image, which is then placed into clipboard so that upon saving I can simply paste it to the filename field saving me the trouble of having to navigate to the desired folder manually every time. Since I'm going for decreasing the amount of clicks, I'd like to have both clipboard operation and Save As dialog to happen at a single click instead of click for copy and right-click for context menu and click to choose "save as".

I'm using Opera 12.17 if it matters.

Edit: It looks like you can call a flash function from outside by Javascript via SWFObject plugin, but that function needs to be declared as external in flash code. I tried looking up the list of available functions in my case, ZClip has none and Downloadify only has unrelated stuff like show/hide/classes, so still no luck.

ZClip has the ability to relay the click event to the object it's glued to, which is on by default, but that still doesn't work in my case, even though I glue it to Downloadify.


Source: (StackOverflow)

Can Cordova 'FileWriter' create/download a PDF document?

I've written a web application to create and download a pdf document on client-side using jsPDF and Downloadify. jsPDF prepares the document and Downloadify downloads it as a pdf. Everything works fine.

I'm trying to replicate this behavior on a PhoneGap app (using FileWriter instead of Downloadify). FileWriter handles writing onto files. Using FileWriter, I've created txt files but couldn't create a pdf.

  1. Is is possible to create a PDF document using Cardova at all?
  2. If not are there any plugins around?

Source: (StackOverflow)

Invoke File save as prompt while Downloading in ExtJS

I want to invoke the file save as prompt while allowing the user to download a file in ExtJS from a URL. Basically the idea is to allow the user to change the file name and select his desired location before saving the file on their machine.

Is there any way I could do this?

I do not want to use:

  1. A server side code to send the headers.
  2. Nor do I want to use the Flash-based Downloadify library to do this.
  3. Also, <a> tag's "download" attribute does download the file, but it does not prompt the dialog box if the browser settings are not set right.

Is there any way apart from the above where we could handle the file download in our application?


Source: (StackOverflow)