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

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?


Who is Participating?
davidlars99Connect With a Mentor Commented:
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.
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.

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.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.


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

Yes, that's exactly what I want to do.
consider using WScript.Shell throughout the application, you'll find it very useful
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.