⑴ JSP 上傳文件進度條怎麼做
HTTP本身無法實現上傳
進度條
,因為無法使用JS訪問文件系統,並對
文件流
進行分回塊。
可以考慮2種方式實現上答傳進度條:
1.flash:flash可以訪問文件系統,並以二進制方式上傳文件,這可以將文件進行分塊;
2.使用
ActiveX控制項
:這個比較復雜一點,能夠監控到每一個位元組的進度,可以自己開發或使用第三方庫。一般來說,對於前台類型的頁面,出於安全和可用性不建議使用ActiveX控制項,
⑵ 用jquery如何實現提交表單點擊提交之後顯示正在上傳中,之後顯示上傳成功的效果
需要准備的材料分別有:電腦、html編輯器、瀏覽器。
1、首先,打開html編輯器,新建html文件,回例如答:index.html,並引入jquery。

⑶ django文件上傳的時候怎麼能加一個上傳進度的顯示
首先需要一個表單來讓用戶選擇要上傳的文件。
1	<form id="form_upload" action="/upload" method="POST">
2	  <input type="file" name="picture" id="picture" />
3	  <input type="hidden" id="X-Progress-ID" name="X-Progress-ID" value=""/>
4	  <input type="hidden" id="id" name="id" value=""/>
5	  <input id="form_submit_button" class="tp-button" type="submit" value="Submit" />
6	  </form>
這里增加了兩個隱藏的輸入框,第一個是 『X-Progress-ID』,代表上傳 ID,這樣我們才能夠在伺服器端支持並發的上傳請求。稍後我們會看到,伺服器是如何處理這個值的。
然後還有一個隱藏輸入框 『id』,在我們的例子里代表菜品的編號。
我們將使用 Ajax 來發送 POST 請求,這樣表單便可以很好地集成在現代的網路界面中,同時包含一個進度條。我們打算使用 jQuery Form plugin 來實現這一點。
函數 ajaxSubmit() 將會幫我們搞定一切。
為上傳 ID 生成一個隨機字串,並用它設置輸入框的值。
需要指定一個用於上傳請求的 URL 和兩個回調函數:一個在請求前調用,另一個在請求完成後調用。
1	$('#X-Progress-ID').val('random string');
2	var options = {
3	  dataType: 'xml',
4	  url: '/upload?X-Progress-ID='+$('#X-Progress-ID').val(),
5	  beforeSubmit: showRequest,
6	  success: showResponse
7	}
8	$('#form_upload').ajaxSubmit(options);
showRequest 回調函數只需要像下面這么簡單就行了:
1	function showRequest(formData, jqForm, options) {
2	    // do something with formData
3	    return True;
4	}
在 showResponse 函數中,我們需要處理響應,並對它進行操作。在我的例子里,我處理了伺服器返回的帶有狀態值的 xml。
1	function showResponse(response) {
2	    // do something with response
3	}
用戶按下提交的時候,我們希望顯示一個進度條,因此可以使用下面的 JS 代碼,向表單添加進度條。progressBar() 方法是 jQuery progress bar plugin 的一部分。
1	$('#form_upload').find('#form_submit_input').append('<span id="uploadprogressbar"></span<');
2	$('#form_upload').find('#uploadprogressbar').progressBar();
現在我們需要添加一個每隔幾秒運行一次的函數,來從伺服器獲取上傳進度,並相應地更新進度條。
為此,我們使用 setInterval() 向伺服器發出一個 GET 請求,獲取 JSON 格式的進度值。我們向伺服器傳送上傳 ID。當返回 null 值的時候,就可以知道上傳已經結束。
01	function startProgressBarUpdate(upload_id) {
02	  $("#uploadprogressbar").fadeIn();
03	  if(g_progress_intv != 0)
04	    clearInterval(g_progress_intv);
05	  g_progress_intv = setInterval(function() {
06	    $.getJSON("/get_upload_progress?X-Progress-ID="
07	+ upload_id, function(data) {
08	      if (data == null) {
09	        $("#uploadprogressbar").progressBar(100);
10	        clearInterval(g_progress_intv);
11	        g_progress_intv = 0;
12	        return;
13	      }
14	      var percentage = Math.floor(100 * parseInt(data.uploaded) / parseInt(data.length));
15	      $("#uploadprogressbar").progressBar(percentage);
16	    });
⑷ asp 如何實現帶進度條的上傳文件功能
以下就以abcupload4為例來說明怎麼來製作實時的文件上傳進度條。 
(註:我們在abcupload自帶例子基礎上改進。) 
progressupload.htm(上傳文件的前台提交,我們讓進度條在這個裡面顯示) 
<HTML> 
<body> 
<script language="javascript"> 
<!-- 
theUniqueID = (new Date()).getTime() % 1000000000; 
function s() //讓數據提交的同時執行顯示進度條的函數 
{ 
bar(); //開始執行反映上傳情況的函數 
document.myform.action = "progressupload.ASP?ID=" theUniqueID; //處理上傳數據的程序 
document.myform.target="up" //將提交的數據放在一個名字是up隱藏的iframe裡面處理,這樣提交的頁面就不會跳轉到處理數據的頁 
document.myform.submit(); //提交表單 
} 
function bar() 
{ 
bar1.style.display=''; //讓顯示上傳進度顯示的層的可見 
var timeoutid=null; //這個變數是作定時器的ID 
var oXMLDoc = new ActiveXObject('MSXML'); //創建'MSXML'對象 
sURL = "progressbar.ASP?ID=" theUniqueID "&temp=" Math.random(); //獲取上傳狀態數據的地址 
oXMLDoc.url = sURL; //load數據 
var oRoot=oXMLDoc.root; //獲取返回XML數據的根節點 
if(oRoot.children != null) 
{ 
if (oRoot.children.item(0).text-100==0) //文件上傳結束就取消定時器 
clearTimeout(timeoutid) 
PercentDone.style.width=oRoot.children.item(0).text "%"; //設置進度條的百分比例 
//根據返回的數據在客戶端顯示 
min.innerHTML=oRoot.children.item(1).text; //顯示剩餘時間(分鍾) 
secs.innerHTML=oRoot.children.item(2).text; //顯示剩餘時間(秒鍾) 
BytesDone.innerHTML=oRoot.children.item(3).text; //已上傳數據大小 
BytesTotal.innerHTML=oRoot.children.item(4).text; //總大小 
BytesPerSecond.innerHTML=oRoot.children.item(5).text; //傳輸速率 
Information.innerHTML=oRoot.children.item(6).text; //上傳信息 
} 
if (oRoot.children.item(0).text-100<0) //只要文件沒有傳完,就每隔多少時間獲取一次數據 
timeoutid = setTimeout("bar()",50) //這里設定時間間隔是0.05秒,你也可以根據你的情況修改獲取數據時間間隔 
} 
//--> 
</script> 
<form name="myform" method="post" action="progressupload.ASP" enctype="multipart/form-data" target=up> 
<input type="file" name="filefield1"><br> 
<input type="button" name="dosubmit" value="Upload" onclick="s()"><br> 
<div id=bar1 style="display:none"> 
<table border="0" width="100%"> 
<tr> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>傳送:</b></font></td> 
</tr> 
<tr bgcolor="#999999"> 
<td> 
<table border="0" width="" cellspacing="1" bgcolor="#0033FF" id=PercentDone> 
<tr> 
<td><font size=1></font></td> 
</tr> 
</table> 
</td> 
</tr> 
<tr> 
<td> 
<table border="0" width="100%"> 
<tr> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">剩餘時間:</font></td> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> 
<span id=min></span> 分 
<span id=secs></span> 秒 
(<span id=BytesDone></span> KB of 
<span id=BytesTotal></span> KB 已上傳)</font></td> 
</tr> 
<tr> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> 
傳送速度:</font></td> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> 
<span id=BytesPerSecond></span> KB/秒</font></td> 
</tr> 
<tr> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">信息:</font></td> 
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><span id=Information></span></font></td> 
</tr> 
</table> 
</td> 
</tr> 
<tr></tr> 
</table> 
</div> 
<iframe name="up" style="display:none"></iframe> 
</form> 
</body> 
</HTML> 
progressbar.ASP(返回上傳狀況數據的文件) 
<%@EnableSessionState=False%> 
<% 
On Error Resume Next 
Set theProgress = Server.CreateObject("ABCUpload4.XProgress") '創建上傳組件對象 
theProgress.ID = Request.QueryString("ID") 
'將返回數據以XML格式輸出 
%> 
<?XML version="1.0" encoding="gb2312" ?> 
<plan> 
<PercentDone><%=theProgress.PercentDone%></PercentDone> 
<min><%=Int(theProgress.SecondsLeft/60)%></min> 
<secs><%=theProgress.SecondsLeft Mod 60%></secs> 
<BytesDone><%=Round(theProgress.BytesDone / 1024, 1)%></BytesDone> 
<BytesTotal><%=Round(theProgress.BytesTotal / 1024, 1)%></BytesTotal> 
<BytesPerSecond><%=Round(theProgress.BytesPerSecond/1024, 1)%></BytesPerSecond> 
<Information><%=theProgress.Note%></Information> 
</plan> 
progressupload.ASP(處理上傳文件) 
<%@EnableSessionState=False%> 
<% 
Response.Expires = -10000 
Server.ScriptTimeOut = 300 
Set theForm = Server.CreateObject("ABCUpload4.XForm") 
theForm.Overwrite = True 
theForm.MaxUploadSize = 8000000 
theForm.ID = Request.QueryString("ID") 
Set theField = theForm("filefield1")(1) 
If theField.FileExists Then 
theField.Save theField.FileName 
End If 
%> 
<HTML> 
<body> 
傳送結束 
</body> 
</HTML>
⑸ JS實現點擊提交表單後,出現一個進度條
簡單的話,用JS模擬一個,用setTimeOut方法
<form name=loading>
<P align=center> </P>
<P align=center> aaaaaaaaaaaaaaaaaaaaaa</P>
<P align=center> </P>
<P align=center><FONT face=Arial color=#0066ff size=2>已經完成:</FONT>    
<INPUT style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bolder; PADDING-BOTTOM: 0px; COLOR: #0066ff; BORDER-TOP-style: none; PADDING-TOP: 0px; FONT-FAMILY: Arial; BORDER-RIGHT-style: none; BORDER-LEFT-style: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-style: none" size=46 name=chart> 
    <BR>
    <INPUT 
style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: #0066ff; BORDER-BOTTOM: medium none; TEXT-ALIGN: center" 
size=47 name=percent>
    <script> 
var bar=0 
var line="||" 
var amount="||" 
count() 
function count(){ 
bar=bar+2 
amount =amount + line 
document.loading.chart.value=amount 
document.loading.percent.value=bar+"%" 
if (bar<99) 
{setTimeout("count()",100);} 
else 
{window.location = "http://www..com";} 
}</SCRIPT>
</P>
</form> 
復雜的話,你還要考慮處理數據的時間問題
⑹ html5怎麼用原生JS上傳表單(多個)的進度條
提供思路:(暫無電腦)
進度條用兩個嵌套組成:內外div,內用來顯示進度條進度,外用來包含整個進度條。進度條百分比利用:offsetleft,width等來設計