1

here is my HTML code what I want is when the file is downloaded I want the radio button to change to green

download and all is happening correctly

<table border="0" cellpadding="2" width="80%">
<tr align="center" style="background:url(../images/nav.png) repeat-x; color:#FFF; font-weight:bold">
    <td>Status</td>
    <td>Request Id</td>
    <td>File Name</td>
    <td>Date</td>
</tr>
<? $sql=mysql_query( "select * from ipad_download "); while($row=mysql_fetch_array($sql)){
?>
<tr align="center" bgcolor="#E8F8FF" style="color:#006">
    <td>
        <input type="radio" name="status" id="status" />
    </td>
    <td>
        <?=$row[ 'RequestId']?>
    </td>
    <td><a href='' onClick="return download_ipadReport('<?=$row['fileName'] ?>');"><?=$row['fileName']?></a>
    </td>
    <td>
        <?=$row[ 'Date']?>
    </td>
</tr>
<? } ?>
</table>

and code to download is

<? 
include '../dbConnect.php';
session_start();
$createdUser=$_SESSION['userName'];


$file=$_GET['file'];
//$file = $createdUser."_".$date.'.xls';
if (file_exists($file)) {
        header('Content-Description: File Transfer');
        header('Content-Type: application/vnd.ms-excel');
        header('Content-Disposition: attachment; filename=ipadServiceReport.xls');
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: must-revalidate');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        readfile($file);
        exit;
    }

?>

so when the file is completly downloaded I want the radio button to become green.

John Dvorak
  • 26,799
  • 13
  • 69
  • 83
namratha
  • 652
  • 2
  • 13
  • 29

1 Answers1

0

There is no straightforward JavaScript event that can let you know a file download has finished.

This question however may offer some workarounds.

Community
  • 1
  • 1
Tank-n-Spank
  • 133
  • 1
  • 9