Tutorial Extjs: Download File
In previous tutorial we have created “upload file text and image using extjs and php“, now we will use the data as practice of downloading file. here i used checkbox selection to select data to be downloaded. to download a file we should get id of the file. Below is part of code from javascript file to get file id will be download.
tbar: [{
text: 'Download',
iconCls:'download',
handler:function(){
var m = SimpleGrid.getSelectionModel().getSelections();
if(m.length > 0)
{
location.href = './article/'+ m[0].get('Fileconten');
}
else
{
Ext.MessageBox.alert('Message', 'Please choose a file that you want to download');
}
}}
]
this is a screen shot of this tutorial.
download source code
http://www.ziddu.com/download/9513551/download-file.zip.html
