CSV Export fails to create a file when using a HTML embeded Object in Firefox and Edge

(2 posts) (2 voices)


No tags yet.

  1. biceda, Member

    I have the following HTML object tag that downloads a CSV file to the local filesystem ie Downloads folder

    <object data="https://domain.com/mydbr/report.php?r=<?php echo $report_id ?>&p1=<?php echo $store_id; ?>&h=<?php echo sha1($report_string); ?>&hdr=0&export=csv" type="text/html"> [code] </object>

    The download works in Chrome (ver 81.0.4044.138) and also works when running the report manually from the mydbr console on the Firefox browser...

    But fails when calling from the HTML code in Firefox (ver 76.0.1) and Microsoft Edge (44.18362.449.0)

    I get no error messages, appears to work, but no file is created. I've check file location settings in the browsers to confirm the default download folder.

    This is the export commands within the report code
    /*select 'dbr.export.options', 'csv.direct_mode', 1;*/
    select 'dbr.export.options', 'csv.header', 0;
    select 'dbr.export.options', 'csv.skip_formatting', 1;

    Is there a debug command/setting within myDBR that could capture a error message etc?

    NB: myDBR ver 5.7.9, php 7


  2. myDBR Team, Key Master

    This is simply a difference how browsers work. Webkit based browsers (Chrome, Safari, Egde, Opera) do download the content, but Firefox does not. What you could do instead, is to present user option to do the download using a-link with download-attribute.

    myDBR Team


You must log in to post.