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
Release: 2016-05-16 17:16:32
Original
1516 people have browsed it

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;
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template