1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Upload *.zip via FTP and unzip it. How?

Discussion in 'Site & Server Administration' started by Wai_Wai, Sep 22, 2005.

  1. #1
    Upload *.zip via FTP and unzip it. How?

    Hi.
    I would like to upload the zipped file via FTP on my hoster's web server.
    Then I unzip it. It is to do with time-saving and efficient upload.
    Currently I'm using Dreamweaver to upload files.

    But I don't know how to unzip a file on a web server.
    How to do, or any programs which can help me to do so?

    Thanks.

    PS:
    About my web server:
    Operating system Linux
    Kernel version 2.4.21-32.0.1.ELsmp
    Machine Type i686
    Apache version 1.3.33 (Unix)
    PERL version 5.8.6
    PHP version 4.4.0
    MySQL version 4.0.25-standard
    cPanel Build 10.6.0-CURRENT 157
    Theme cPanel X v2.5.0
     
    Wai_Wai, Sep 22, 2005 IP
  2. TheHoff

    TheHoff Peon

    Messages:
    1,530
    Likes Received:
    130
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe you will have to have command line access such as through an SSH port--

    Try putty
     
    TheHoff, Sep 22, 2005 IP
  3. web-spy

    web-spy Active Member

    Messages:
    127
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #3
    You could write a php script which unzips the file to a specific directory...
     
    web-spy, Sep 22, 2005 IP
  4. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    How to write?
    I know nothing about php.
     
    Wai_Wai, Sep 22, 2005 IP
  5. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'm using cPanel / Fantasico.
    Not sure if there's any SSH port.
     
    Wai_Wai, Sep 22, 2005 IP
  6. tomecki

    tomecki Peon

    Messages:
    369
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I have a cgi / perl that can uncompress your zip file.
     
    tomecki, Sep 22, 2005 IP
  7. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Care to display the code?
     
    Wai_Wai, Sep 22, 2005 IP
  8. tomecki

    tomecki Peon

    Messages:
    369
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    #!/usr/bin/perl
    use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
    use CGI qw/:standard/;

    print header;
    print start_html(
    -title=>'Rozpakuj',
    -author=>'Tomecki',
    );




    print h1({-align=>'center'},'Rozpakuj');
    print '<center>';

    print startform(
    -method=>GET);

    print textfield(
    -name=>'katalog',
    -default=>'wpisz katalog',
    -size=>50,
    -maxlength=>80);
    print br;
    print submit(
    -name=>'submit',
    -value=>'Wyslij');
    print '</center>';
    print endform;

    if (param('submit')) {

    $katalog=param('katalog');
    my $ofile = "\.\.\/$katalog\/gotowe.zip";

    # extract a zip file

    $zip = Archive::Zip->new();
    die 'Error reading zip file.' if $zip->read( $ofile ) != AZ_OK;
    my @members = $zip->members();
    @a= $zip->memberNames();
    $m=0;
    foreach $element(@members)
    {
    $zip->extractMember($element, "\.\.\/$katalog\/$a[$m]");
    $m++;
    }
    print "Done!";
    }

    print end_html;


    You should use zip file named "gotowe.zip" and put it in certain directory and write this directory to the field.
     
    tomecki, Sep 22, 2005 IP
  9. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #9
    Look on your Cpanel. It should have an option to connect by SSH via web.

    But keep in mind that you should know how to use unix commands to uncompress the file.
     
    tresman, Sep 22, 2005 IP
  10. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10

    Thanks for your script!
     
    Wai_Wai, Sep 22, 2005 IP
  11. enQuira

    enQuira Peon

    Messages:
    1,584
    Likes Received:
    250
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I believe you are using site5 as your webhost.
    If this is the case you can ask the support to enable shell access. afterwards you will just have to unzip the file inside the directory after uploading it using dreamweaver if you wish.

    gunzip filename.tar.gz
    tar -xvvf filename.tar

    and that's it
     
    enQuira, Sep 22, 2005 IP
  12. enQuira

    enQuira Peon

    Messages:
    1,584
    Likes Received:
    250
    Best Answers:
    0
    Trophy Points:
    0
    #12
    and that was my 100th post :)
     
    enQuira, Sep 22, 2005 IP
  13. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #13
    Got telnet access??? Log in as your site admin, go to the directory with the zip file where you want to unzip it and enter

    unzip file.zip

    No need for a script!

    DON'T DO THIS AS su root!!!! Do that and you won't have very fun updating the files through ftp, since you don't log in as root on ftp!!!!
     
    Nintendo, Sep 22, 2005 IP
  14. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Where do I type these 2 lines?
     
    Wai_Wai, Sep 22, 2005 IP
  15. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Congratulations!
    However I'll catch you up soon. ;)
     
    Wai_Wai, Sep 22, 2005 IP
  16. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #16
    I don't know.
    I have to check.
     
    Wai_Wai, Sep 22, 2005 IP
  17. enQuira

    enQuira Peon

    Messages:
    1,584
    Likes Received:
    250
    Best Answers:
    0
    Trophy Points:
    0
    #17
    you will write them in an ssh client (putty for instance) but first you have to ask the admins to enable shell access (I am assuming your webhost is site5). if this is the case, go to the NetAdmin panel, in the advanced tools tab you will find (Get shell access)
    hope this helps

     
    enQuira, Sep 22, 2005 IP
  18. Wai_Wai

    Wai_Wai Peon

    Messages:
    117
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Thanks. I will ask the moderator about that.
     
    Wai_Wai, Sep 22, 2005 IP
  19. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #19
    I believe cpanel has a file manager and after upload you can uncompress the file there.
     
    RectangleMan, Sep 23, 2005 IP
  20. enQuira

    enQuira Peon

    Messages:
    1,584
    Likes Received:
    250
    Best Answers:
    0
    Trophy Points:
    0
    #20
    yup ! you can definitely do that
     
    enQuira, Sep 23, 2005 IP