Reputation: 590
I'm a newby in Ext JS and I need to make a restful call that returns a file to the browser. How should I do this?
This is what I have so far, the call is return but I can't get the file downloaded to the browser.
Ext.onReady(function () {
form = Ext.Ajax.request({
url: 'http://localhost:8080/getfile',
success: function(x){
return x;
},
failure: function () { console.log('failure');},
params: {'someparams': Ext.encode ({'abc': {'hello': '123'}})
}
});
});
Upvotes: 2
Views: 10116
Reputation: 483
Sometimes you can use original javascript:
document.location = "/getfile?abc=123";
Upvotes: 1
Reputation: 8605
You might find this thread or this post useful. Basically don't use AJAX here, use a <form>
to submit your request
Upvotes: 1