[eluser]New One[/eluser]
Hello All,
I want mi code to do this:
after pressig download - the download screen appears and in the same time previous window is closing.
controller:
function download(){
$basePath = 'c:/';
$data = file_get_contents("$basePath/instructions.txt");
$name = "instructions.txt";
force_download($name, $data);
}
view:
function GoClose()
{
//window.close();
}
<?=form_open('/test/download/', $data)?>
<?echo '<input type="image" name="submit" onmousedown = "GoClose()" src="/images/down.png" />';?>
<?=form_close();?>
Something like this. Can someone help me?