<%
response.setHeader("pragma", "no-cache");
response.setHeader("cache-control", "no-cache");
response.setDateHeader("Expires", 0);
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>上传进度</title>
<script language="javascript" type="text/javascript">
function round(number, X) {
// rounds number to X decimal places, defaults to 2
X = (!X ? 2 : X);
return Math.round(number * Math.pow(10, X)) / Math.pow(10, X);
}
function formatBy(bytes) {
var sunit = "";
var res = 0;
if (bytes > (1024 * 1024 * 1024))
{
res = (bytes / (1024 * 1024 * 1024));
// g
sunit = "G";
}
else if (bytes > (1024 * 1024))
{
res = (bytes / (1024 * 1024));
// m
sunit = "M";
}
else if (bytes > (1024))
{
res = (bytes / (1024));
// k
sunit = "K";
}
else
{
res = bytes;
sunit = "B";
}
return round(res) + " " + sunit;
}
function GetProgressDetail()
{
// var funid = (new Date()).getTime();
// alert("1");
var funid = document.getElementById("funid").value;
window.status = "1";
//alert(funid);
var detail = new ActiveXObject("Microsoft.XMLHTTP");
// detail.setRequestHeader('cache-control','no-cache');
detail.open("GET", <%="\""+response.encodeURL("accessoryServlet?funid=")+"\""%>+funid , false);
detail.send();
var detail_info = detail.responseText;
var start = detail_info.indexOf("<detail-start>");
var end = detail_info.indexOf("</detail-start>");
if (start != -1 && end != -1) {
detail_info = detail_info.substring(start + 14, end);
var detail_info_array = detail_info.split("||");
var fileName = detail_info_array[0];