Search code examples
javascriptangularjsdownloadify

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 ?


Solution

  • Check file properties of the 'download.png' file on the server to ensure it is accessible by the web user. (depending on what web server you are using)

    try accessing the image by navigating to http://{yourHostname}/download.png