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" ?