简体   繁体   English

如何在asp.net中的Web服务器上压缩大量文件时在客户端显示zip的大小

[英]how to show the size of zip at the client side while zippping large batch of files on web server in asp.net

When the user selects the list of files from a page and hit's download selected, then a post back happens to server and starts zipping on the server. 当用户从页面中选择文件列表并选择下载的文件时,服务器上将发生回发并开始在服务器上压缩。 This works great until we hit the timeout on the page ( which is default to 90 seconds ) and just returns the process to the page even though the backend process is still zipping. 这很有效,直到我们达到页面上的超时(默认为90秒),并且即使后端进程仍在压缩,它也只将进程返回到页面。 Is it possible to show the size of zip file when the file is being zipped instead of waiting till the end to provide the download link? 压缩文件时是否可以显示zip文件的大小,而不是等到最后才提供下载链接?

You can use ActiveX components to do that: 您可以使用ActiveX组件来做到这一点:

var oas = new ActiveXObject("Scripting.FileSystemObject");
var d = filepath;
var e = oas.getFile(d);
var f = e.size;
alert(f + " bytes");
}

but it will limit you to IE and should have appropriate IE security settings. 但是它将限制您使用IE,并且应具有适当的IE安全设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在ASP.NET中创建客户端“显示/隐藏”面板 - How to create a client side Show/Hide panel in ASP.NET ASP.NET 核心 web 应用 - 如何上传大文件 - ASP.NET Core web application - How to upload large files 如何在不将文件下载到Web服务器的情况下使用asp.net mvc将文件传送到客户端? - How to work with file delivery to the client in asp.net mvc without downloading the files on the web server? ASP.NET Core-如果不存在用于选择文件的客户端UI,如何上传zip文件 - ASP.NET Core - How to upload a zip file if there does not exist a client-side UI for file selection 在服务器端ASP.Net上访问客户端阵列 - Accessing Client-Side arrays on Server Side ASP.Net 在asp.net的客户端中调用服务器端方法 - Calling a server side method in client side in asp.net ASP.NET MVC 中的客户端和服务器端验证 - Client side & Server side validations in ASP.NET MVC 如何在ASP.NET中从客户端调用服务器端函数? - How to call server-side function from client-side in ASP.NET? 如何在asp.net中将服务器端页面的值传递给客户端功能 - How to pass a value from server side page to client side function in asp.net ASP.NET双列表框使用JQuery更新了客户端,以及如何在服务器端检索结果 - ASP.NET dual listboxes updated client-side with JQuery, and how to retrieve the results server-side
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM