My application uses ExtJs as front end ans Spring MVC+Hibernate JPA as backend. I need to download a file. The url of the document is retrieved using the AJAX request.there is a Download button, and when the user clicks it, there should be an option for Save As.
var body = Ext.getBody();
var form = body.createChild({
tag:'form'
,cls:'x-hidden'
,id:'form'
,action:'document/download/'+selDocument.data.documentId
,target:'iframe'
});
form.dom.submit();
This code is working fine for me now. The only problem is that the page gets refreshed when I click download. Is there any way to avoid that?