а

Download file


#1

I have an asp file that renders an XLS file and then downloads it. This works interactively however, when I invoke it in a function that is called by an image button, nothing seems to happen. I’m using ajax post in the following way:

{ view: "imagebutton", width: 30, label: "", align: "right", src: "./images/t_download.png", click: "downloadXLS();" }

....

function downloadXLS() 
{
 dhx.notice({ delay: 1000, message: "starting download ..." });
 dhx.ajax().post("exporttoxls.asp?fileid=" + fileId + "&", formData);
}

Does the post somehow interfere with the download?


#2

Yep, ajax operation will not trigger download
Change it as

dhx.send("exporttoxls.asp?fileid=" + fileId + "&", formData);

it will work exactly as form submit


#3

Works fine - thank you.


#4

Works fine on Chrome (Windows and Android) but on Mozilla on Android the download takes the name of the asp file instead of the name of the xls (and so fails) and Firefox on Windows truncates the name of the xls to the first word.

Does anyone have any idea how I may get Mozilla to behave properly?


#5

Thanks for providing this. I was recently looking out for something similar to dailymotion downloading tool and now I have found it.
I needed it to work as a Form Submit and I can.