views:

42

answers:

3

Hi, in my webpage i have a button , that let me download an excel file(generated by php code). This part is called after clicing the button.

<script type="text/javascript">
    window.open('siem_xls_download_d.php?adatum=<?=$adatum?>&edatum=<?=$edatum?>&ir_qot_id_lang=<?=$ir_qot_id_lang?>', target="_top", "Zweitfenster","width=200,height=140,left=400,top=280");
    </script>
    <? } elseif ($output_pdf == "pdf") { ?>
    <script type="text/javascript">
    window.open('siem_pdf_download_d.php?adatum=<?=$adatum?>&edatum=<?=$edatum?>&ir_qot_id_lang=<?=$ir_qot_id_lang?>',"Zweitfenster","width=500,height=400,left=200,top=100");
</script>

After clickig it in ie8 I'm getting a popup window where im beeing asked if I really want to downlooad this file. Afetr maybe 1 sec the window is beeing closed. If i change a traget to "_top" the window is being kept open. But it opens a new tab, what is not what I want. How could I force IE8 to keep the popup open? I wish to have a small window with target ="_blank".

Thanks Magda Muskala

A: 

Why use window.open() for this in the first place?

A link pointing to the download URL:

<a href="....." target="_blank">Download</a>

would be much cleaner and might trigger less warnings in IE8 (although those are really outside your control).

Pekka
A: 

It sounds like this could be an issue with a third-party plugin for IE. Check to make sure that all of your extensions are disabled and you don't have any popup blockers running. I know it sounds dumb, but I've hit something like this a few times myself.

Hope this helps

mattbasta
A: 

did you put proper header for pdf in the php file

http://davidwalsh.name/php-header-mime

header('Content-type: application/pdf');

zod