2013-10-01 19 views
1

這裏是我的HTML代碼 什麼,我要的是當文件被下載我想要的單選按鈕切換到綠色改變單選按鈕的顏色,當文件被完全地下載

下載和所有正確發生

<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> 

和代碼下載是

<? 
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; 
    } 

?> 

因此當文件被完全地下載我想要的單選按鈕變成綠色。

回答

0

沒有簡單的JavaScript事件可以讓你知道文件下載已經完成。

This question但是可能會提供一些解決方法。