How do I unzip files on a remote server?

  • mmmwowmmm
  • Novice
  • Novice
  • No Avatar
  • Joined: Nov 29, 2005
  • Posts: 22
  • Status: Offline

Post December 11th, 2006, 12:40 am

My website is hosted at godaddy.com, and I am in the process of uploading about 40,000 small files onto their server. I'm using an FTP program, and it's taking forever.

I know there is way to upload a single zip file and then unpack it on the server, but I have not been able to figure it out.

I've gone through this again and again at webmasterworld, but no one will give me a simple step-by-step answer. They say things like "you have to run 'man unzip' at the command line", and then I ask what that means and they tell me something else that means nothing to me.

Eventually I figure out that I can use a command line in my FTP program, but when I type in "man unzip" nothing happens. At all.

So I explain this to the people on the forum, and they say that I should download "putty", and that should work (but only if my hosting service supports SSH, whatever that is), so I find "putty" and download it, but it doesn't work either. It takes me a while to figure this out, because "putty" is not really a "user-friendly" program - it's one of those programs written for people who already know what they're doing. I don't really know what I'm doing.

So I go back to webmasterworld and explain that this isn't working either. Isn't there a simple A-B-C-1-2-3 way to do this? It can't be that hard, right?

The response I get: "Maybe you should write a custom script to execute the unzipping process."

It's really frustrating.

And the thing is, I know that when someone finally does give me the answer I'm looking for, it's going to be something very simple.

So please - if there's someone out there who can just give me a plain-language "step 1, step 2, step 3" explanation on how to do this, I'd be extremely grateful.

Thanks,
Phil
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 11th, 2006, 12:40 am

  • grinch2171
  • Moderator
  • Genius
  • User avatar
  • Joined: Feb 11, 2004
  • Posts: 6737
  • Loc: Martinsburg, WV
  • Status: Offline

Post December 11th, 2006, 5:14 am

I don't know if this will help you or not but my webhost uses cpanel to manage the domain and when I am in the file manager (this is where you can upload, copy, delete and move files) I have an option to unzip uploaded zip files.

I don't know if godaddy offers this but it is worth looking into.
‎"Be polite, be professional, but have a plan to kill everybody you meet." Maj. Gen. James Mattis
  • mmmwowmmm
  • Novice
  • Novice
  • No Avatar
  • Joined: Nov 29, 2005
  • Posts: 22
  • Status: Offline

Post December 11th, 2006, 12:08 pm

Thanks, grinch. Actually, godaddy doesn't use cpanel, they use "PhpMyAdmin" for their control panel. It has a simple FTP client, but no way to unzip files...
  • winnie
  • Born
  • Born
  • No Avatar
  • Joined: Feb 28, 2007
  • Posts: 1
  • Status: Offline

Post February 28th, 2007, 8:54 am

I know this issue it is getting on my nerves too. Godaddy doesn't give ssh, no cpanel, the misery... :x

I've started with ZipDeploy since my first website hosted by yahoo : same problem: ftp, phpmyadmin, no real
control panel... So what I do, is create a Zip archive of my multiple files and unzip it remote with this software. Actually I'm replicating my Joomla installs with it (you can also crerate a Zip on server and download it)

here's the link : http://ftp-unzip.com/ZipDeploy/
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post February 28th, 2007, 2:56 pm

Does this make any sense to you ?

http://scripts.ringsworld.com/affiliate ... b.php.html

Code: [ Select ]
<html>
<head><title>unzip</title>
<style>.err{color:#900;font-weight:bold;}</style>
</head><body>
<?php
    if(empty($_GET['archives'])){die("Missing archive list</body></html>");}
    $archive = explode(",", $_GET['archives']);
    $at = count($archive);
    if($at < 1){die("Missing archive list</body></html>");}
    
    require_once('pclzip.lib.php');
    
    for($i=0; $i<$at; $i++) {
        $zipfile = new PclZip($archive[$i]);
        if ($zipfile -> extract() == 0) {
            echo '<div class="err">Error : ' . $archive[$i] . '<br/>' . $zipfile -> errorInfo(true) . '</div>';
        }else{
            echo '<div>Extracted : ' . $archive[$i] . '</div>';
        }
    }
?>
</body></html>
  1. <html>
  2. <head><title>unzip</title>
  3. <style>.err{color:#900;font-weight:bold;}</style>
  4. </head><body>
  5. <?php
  6.     if(empty($_GET['archives'])){die("Missing archive list</body></html>");}
  7.     $archive = explode(",", $_GET['archives']);
  8.     $at = count($archive);
  9.     if($at < 1){die("Missing archive list</body></html>");}
  10.     
  11.     require_once('pclzip.lib.php');
  12.     
  13.     for($i=0; $i<$at; $i++) {
  14.         $zipfile = new PclZip($archive[$i]);
  15.         if ($zipfile -> extract() == 0) {
  16.             echo '<div class="err">Error : ' . $archive[$i] . '<br/>' . $zipfile -> errorInfo(true) . '</div>';
  17.         }else{
  18.             echo '<div>Extracted : ' . $archive[$i] . '</div>';
  19.         }
  20.     }
  21. ?>
  22. </body></html>
Strong with this one, the sudo is.
  • crazzyDemon
  • Beginner
  • Beginner
  • User avatar
  • Joined: Feb 01, 2007
  • Posts: 55
  • Status: Offline

Post March 1st, 2007, 2:07 am

Do you have SSH access to your host account if yes
i can give you an instractions step-by-step how unzip files with ssh
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post March 1st, 2007, 5:20 am

crazzyDemon wrote:
Do you have SSH access to your host account


mmmwowmmm wrote:
My website is hosted at godaddy.com

...

Thanks,
Phil


http://help.godaddy.com/article.php?art ... opic_id=80
Strong with this one, the sudo is.
  • johnbc
  • Born
  • Born
  • No Avatar
  • Joined: Apr 30, 2007
  • Posts: 1
  • Status: Offline

Post April 30th, 2007, 2:40 pm

if using linux / PHP
make php file of following:

<?php system('unzip zipFileName.zip'); ?>

and run from browser.
It will expand on the server (and save bandwidth).
  • murcielagossi
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jul 28, 2006
  • Posts: 457
  • Status: Offline

Post April 30th, 2007, 3:39 pm

Try running this PHP script provided that you change filenames and server directories.
(i.e. Replace 'test.zip' with 'yourzipfile.zip' and 'destination/dir/' to '/www/whateveryoursiteis/directory')

PHP Code: [ Select ]
<?php
 
$zip = new ZipArchive;
 
if ($zip->open('test.zip') === TRUE) {
 
    $zip->extractTo('/my/destination/dir/');
 
    $zip->close();
 
    echo 'ok';
 
} else {
 
    echo 'failed';
 
}
 
?>
  1. <?php
  2.  
  3. $zip = new ZipArchive;
  4.  
  5. if ($zip->open('test.zip') === TRUE) {
  6.  
  7.     $zip->extractTo('/my/destination/dir/');
  8.  
  9.     $zip->close();
  10.  
  11.     echo 'ok';
  12.  
  13. } else {
  14.  
  15.     echo 'failed';
  16.  
  17. }
  18.  
  19. ?>


P.S: This function will overwrite destination files with the same name.

Good Luck!
Image
/* My Logic Is Undeniable */
  • starlight36
  • Born
  • Born
  • No Avatar
  • Joined: May 02, 2007
  • Posts: 1
  • Status: Offline

Post May 2nd, 2007, 12:59 am

PHP
GZIP
ASP
WEBSHELL
RAR.EXE
ZIP
  • murcielagossi
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jul 28, 2006
  • Posts: 457
  • Status: Offline

Post May 2nd, 2007, 6:01 pm

Since you don't have SSH access you pretty much have to use PHP, (i.e. my other post or find some "PHP unzipping script" of your own)
Image
/* My Logic Is Undeniable */
  • compaqras
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Apr 18, 2006
  • Posts: 8
  • Status: Offline

Post May 25th, 2007, 4:06 pm

crazzyDemon wrote:
Do you have SSH access to your host account if yes
i can give you an instractions step-by-step how unzip files with ssh


do you mind if you give instructions to me, man; i have same problems, and i have ssh too. just don't know how to unzip or zip it. if you have other commands please list it too.
bye
  • Kevin Monk
  • Born
  • Born
  • No Avatar
  • Joined: Jun 03, 2007
  • Posts: 1
  • Loc: London, UK
  • Status: Offline

Post June 3rd, 2007, 3:22 am

johnbc wrote:
if using linux / PHP
make php file of following:

<?php system('unzip zipFileName.zip'); ?>

and run from browser.
It will expand on the server (and save bandwidth).


That works perfectly. Thanks John.

Simple. Concise. Would be a 1-2-3 steps except there's only about 1 step.
  • fionab
  • Born
  • Born
  • No Avatar
  • Joined: Sep 22, 2007
  • Posts: 1
  • Status: Offline

Post September 22nd, 2007, 4:13 am

I seem to missing something all I get returned when I run this is the following: Archive: site-localhost-20070922-100224.zip
What else do I need to get it it run?
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post September 22nd, 2007, 6:42 pm

Kevin Monk wrote:
johnbc wrote:
if using linux / PHP
make php file of following:

<?php system('unzip zipFileName.zip'); ?>

and run from browser.
It will expand on the server (and save bandwidth).


That works perfectly. Thanks John.

Simple. Concise. Would be a 1-2-3 steps except there's only about 1 step.


It doesn't work for me :shock:
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 22nd, 2007, 6:42 pm

Post Information

  • Total Posts in this topic: 19 posts
  • Users browsing this forum: No registered users and 131 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.