[英]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.