PDA

View Full Version : download pdf with form submit



igi
16 Feb 2010, 2:59 AM
penilaian_panel.getForm().submit({
url: 'cetak_penilaian.php',
waitMsg : 'Waiting..',
success: function(penilaian_panel, o){
Ext.Msg.alert('Success', o.result.file);;
},
failure : function(){
Ext.Msg.alert('Error', 'Kesalahan Pada Koneksi database');
}
});
and then php file


header ('Content-type: application/pdf');
header ('Content-Disposition: attachment; filename="sample.pdf"');

//some logic

echo '{success:true, file:'.json_encode('success').'}';
pdf file has successfully download, but "waitMsg" didn't stop.please help me

19 Feb 2010, 5:55 AM
you're better off just invoking a hidden iframe. This way you don't have to track the download.

Animal
19 Feb 2010, 6:36 AM
It's fine the way the OP has it.

It's just that you can't use a mask.

You can't know when an attachment has been downloaded.