PDA

View Full Version : Download a File



blade226
21 Sep 2015, 3:29 AM
Hi,
I want to create and download a rtf-file.

A php-Script creates the file:



header('Content-Type: application/rtf');
header('Content-Length: ' . strlen($var));
header('Content-Disposition: attachment; filename="test.rtf"');


And when i start the script stand alone in the browser, the save as windows is displayed

And the Ext-file should start the php-script



text : 'Verfügung Antrag',iconCls: 'employee-remove',handler: function() {

var displayField = itemMenu.query('#gridRecord')[0];
recordData = record.data;
Ext.Ajax.request({
url:"php/verfuegung.php?id_schuljahr=" + recordData.id_schuljahr,
success:function(a,b){
//traeger_informationen.close();
//mystore_massnahmen.reload();
}
});
}
}

The request starts the script, but nothing happens.

I'm grateful for any help

Mark Wagoner
21 Sep 2015, 3:40 AM
Instead of issuing an Ajax request use window.open to tell the browser to send the request in a new window/tab

blade226
21 Sep 2015, 10:17 PM
Instead of issuing an Ajax request use window.open to tell the browser to send the request in a new window/tab

And when I open a new window, who can I tell him to open the php script?

blade226
21 Sep 2015, 10:20 PM
I found it: window.open("php/verfuegung.php"); Thank you!