JavaScript to unzip a zipped file transferred by FTP to a remote server

Posted on 2005-05-09
Last Modified: 2008-02-26
Experts, please

My app uploads to a remote folder multiple files by FTP.

I would like to zip these into one file, upload the one file, and then have the one file unzip automatically while preserving the folder structure.

Please can experts  suggest a JavaScript strategy for the automatic unzipping within the remote folder?


Question by:Gordon_Atherley
    LVL 8

    Expert Comment

    There are several points in your scenario which are not going to work:
    1.) You cannot access files on browser side by JavaScript.
    2.) You cannot do zipping or run WinZip to compress any data.
    3.) You cannot access anything on server side by using client side JavaScript.

    So the answer is: No way.

    LVL 8

    Expert Comment

    And if your question is only how to unzip the file sent by ftp on server side, then you should look for the command line version of WinZip to run that command on server side.
    LVL 13

    Expert Comment


    you want to zip files client-side and then after the upload unzip them on server-side?

    Author Comment


    Yes, that's exactly what I want to do.
    LVL 13

    Accepted Solution

    you can do this, but with very limited options and very serious security voilations. I'd rather list those options one after another, that way you can better understand what's what and where.

    1). to zip files you need to have some kind of component i.e. Winzip Command Line Support, which enables you to compress files from Windows Command line, it can be found here

    2). then to upload files to the server you're gonna need another component or there's a program already developed and shipped with windows OS, it's in "c:\windows\system32\ftp.exe". it's a fully functional FTP client and in fact it is very useful.

    3). once the files have been uploaded you can use ASP or ASP.NET to unzip them at the specific location.

    all this involves the heavy usage of not so popular ActiveX, which is only supported by IE and is known as a big security hole for hackers, if you allow me to run my ActiveX object on you browser I can take full advantage of it and do whatever I want with your computer, so basically you would have to stay within the frames of *intranet zone* and be extremely careful.
    LVL 13

    Expert Comment

    consider using WScript.Shell throughout the application, you'll find it very useful

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Both jQuery and Mootools offer some nice, easy to use scripts. Mootools is best known for their interactive slideshows and jQuery for their menus, but both have many other uses as well.   jQuery is basically a toolkit with many DOM (http://en.wik…
    I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now