Fog Creek Software
Discussion Board




Unzipping a file on a FTP Server


I would like to have a process which does the following :

1/ Upload a ZIP file to a FTP server (easy)
2/ Unzip the uploaded file on the remote FTP server(in the same directory the file) : IS THIS POSSIBLE?

JFK
Thursday, April 01, 2004

Ride your bike down to the data center, log onto the ftp server using a vt100 terminal. CD to the directory you uploaded the file to and type "unzip <filename>". Should work.

  -tim (IV.1.2004)

a2800276
Thursday, April 01, 2004

Maybe there's a DCOM component you could instanciate on the server side ?

Juregen
Thursday, April 01, 2004

Perhaps you can telnet to the FTP server after unloading, so you can run the unzip command by hand; or have a daemon running on the server that continually scans the FTP directory and unzips what it finds there.

Christopher Wells
Thursday, April 01, 2004

Actually, this is a heck of an idea.  It would be nice if ZIP and UNZIP commands became part of the FTP protocol.

I maintain quite a few websites via FTP, and don't have remote desktop/shell access to the machines.  It sucks when I have to wait a million years for a 200MB database backup file to transfer... especially when I *know* that database file could be zipped down to 10MB.

Of course, this will never happen.  FTP servers *and* clients would all have to start supporting it.

John Rose
Thursday, April 01, 2004

But it's for file transfer, not for file zipping :) That's probably why it wasn't in the RFC, because compression on the server is a different issue.

Since we're on wishes, I'd actually like to have something like mod_gzip transparently compress a transmitted file (if you're transferring in ASCII mode, say..) and send it over to the client.

All the advantages of a minimal transfer size, but it's completely transparent to both server and client implementations that don't support it (just think of it like a filter that sits inbetween and does compression)

deja vu
Thursday, April 01, 2004

>>I maintain quite a few websites via FTP, and don't have remote desktop/shell access to the machines. 

Simple, write a script that takes the parameters needed to unzip the file (.zip name, destination, etc) and then does the unzip (via a 'shell' or 'system' command if necessary).

Put the script in your password-protected admin directory (you have one of those, right?) so only you can access it.

Simple solution (or just use a generic solution like PHPshell - http://www.gimpster.com/wiki/PhpShell )

RocketJeff
Thursday, April 01, 2004

If you use sftp (the ssh style tool for ftp) it should compress it as you transfer it, which is what it seems like you want.  You get the short transfer time with the security as well.

An to the other person in this discussion that mentioned telnet, telnet bad.  ssh good.  I used to not care until I spent less than 5 minutes with ethereal (windows port sniffer) and caught my POP password and telnet session floating by.  I use the secure versions of each now :-)

Andrew Hurst
Thursday, April 01, 2004

To do this you'd need to be able to install your own scripts, chron job (assuming it's a Unix like server), and/or FTP server.

One possibility is this: The FTP server "Pure-Ftp" has a feature that allows a script to be activated upon the successful upload of a file. So, you could install Pureftpd and write a script to do exactly what is needed.

Check out: http://www.pureftpd.org/README

Specifically, the --with-uploadscript option.

I've installed Pureftpd to Free BSD and Linux. It's dead easy to get going.

Bored Bystander
Thursday, April 01, 2004

check out http://www.web2ftp.com

web interface but it does allow you to upload zip file and have it unzipped on the other end.

Tapiwa
Thursday, April 01, 2004

Most servers used to have that feature, at least when downloading. You could say 'get directory.tar' or even 'get directory.tar.gz' which would then transparently archive and/or compress the file when sending it to you. Pipes were all the unix rage you know, so it makes sense.

Jonas B.
Thursday, April 01, 2004

Does anyone know of a Perl-based script similar to PhpShell?

Anechoic
Thursday, April 01, 2004

Nevermind, I found a script called "The Commander".

Anechoic
Thursday, April 01, 2004

*  Recent Topics

*  Fog Creek Home