【问题标题】:how to show the size of zip at the client side while zippping large batch of files on web server in asp.net如何在asp.net的Web服务器上压缩大量文件时在客户端显示zip的大小
【发布时间】:2010-11-08 16:10:47
【问题描述】:

当用户从页面中选择文件列表并点击下载时,服务器会发生回发并开始在服务器上压缩。这很有效,直到我们在页面上达到超时(默认为 90 秒)并且即使后端进程仍在压缩,也只是将进程返回到页面。是否可以在压缩文件时显示压缩文件的大小,而不是等到最后提供下载链接?

【问题讨论】:

    标签: c# asp.net jquery json


    【解决方案1】:

    您可以使用 ActiveX 组件来做到这一点:

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

    但它会限制您使用 IE,并且应该有适当的 IE 安全设​​置。

    【讨论】:

    • firefox和chrome怎么样?
    猜你喜欢
    • 2015-01-19
    • 2012-10-27
    • 2018-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-30
    • 1970-01-01
    相关资源
    最近更新 更多