Hello Everybody,
First of all I am working on CRM Online 8.2
I'm trying to download a file, using this code:
var blob = new Blob([file],
{
type: type
});
var URL = window.URL || window.webkitURL;
var downloadUrl = URL.createObjectURL(blob);
if (filename)
{
var a = document.createElement("a");
if (typeof a.download === 'undefined')
{
window.location = downloadUrl;
}
else
{
a.href = downloadUrl;
a.download = filename;
document.body.appendChild(a);
a.click();
}
Assuming that "document.createElement" is not supported, I found another solution, that is using an Html page that holds the download.
The probleme is that I dont know how to pass blob to the html, I tried:
var customParameters = encodeURIComponent("first="+blob+");
Xrm.Utility.openWebResource('Shared/Download',customParameters,300,300);
Unfortunatly does'nt work.
Have you any idea?
Thank you
Regards,
Saad