Home >Web Front-end >JS Tutorial >Example of method to implement file download in ExtJS_javascript skills

Example of method to implement file download in ExtJS_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:16:321534browse

Frontend code:

Copy code The code is as follows:

Ext.get('outputuser'). on('click', function(e){
Ext.MessageBox.confirm('Prompt', 'Are you sure you want to export users?', function(btn){
if(btn=="yes") {
Ext.Ajax.request({
url: "You can get the url of the file to be downloaded",
success:function(res){
var obj =Ext.decode(res.responseText) ;
          //alert(res.responseText); 
       window.location.href =obj.path; ;


Backend:



Copy code
The code is as follows: $json = '{"path":"/web/ii.rar"}';echo $json;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn