开发者

Zip File on a web server to extract in to local machine

We have a web application that allows user to d开发者_Python百科ownload a zip file from a web server. We just provide dummy iframe source to the full URL of zip file on web server. This approach would allow end user to use browser controls which allows the user to open or save the zip to user's local machine.

We have a requirement that the zip file is automatically extracted and save to a specific location on user's machine. Any thoughts on how this can be achieved?

Thanks.


I highly doubt that you'll be able to do that. The closest you're likely to get is to generate a self-extracting executable file (which would be OS-dependent, of course).

I certainly wouldn't want a zip file to be automatically extracted - and I wouldn't want my browser to be able to force that decision upon me.


Short answer is I don't believe this is possible using the simple URL link you've implemented.

Fundamentally the problem you have is that you have no control over what the user does on their end, since you've ceded control to the browser.

If you do want to do this, then you'll need some client-side code that downloads the zipfile and unzips it.

I suspect Java is the way to go for this - Javascript and Flash both have problems writing files to the local drive. Of course if you want to be Windows only then a COM object could work.


Instead of sending a zip file why don't u instruct the web server to compress all the web traffic and just send the files directly? See http://articles.sitepoint.com/article/web-output-mod_gzip-apache# for example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜