[英]how to implement progress bar of file upload using jquery in asp.net?
嗨,我正在上传一个文件,为此我已经实现了 aspx 和 .cs 页面。但现在我只想添加进度条。怎么做?
protected void btnUpload_Click(object sender, EventArgs e)
{
HttpPostedFile postedFile = FileUpload1.PostedFile;
string ClientFileName, ServerFileName;
if ((FileUpload1.HasFile && FileUpload1.PostedFile != null) || txtUrl.Text!="")
{
lblOutput.Text = "";
HttpPostedFile myFile = FileUpload1.PostedFile;
ServerFileName = System.IO.Path.Combine(ServerSavePathI, ClientFileName);
string serverPath = Server.MapPath(ServerFileName);
FileUpload1.SaveAs(serverPath);
}
}
这是.cs文件的代码按钮上传的点击事件
这不是单独使用 jQuery 可以正确实现的。 您需要使用像NeatUpload这样的组件,其中包括一个服务器端模块来跟踪上传了多少数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.