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.

Extracting .zip file on web

Discussion in 'PHP' started by srobona, Mar 9, 2007.

  1. #1
    Hi,
    I'm looking for a solution of the following problem:

    I have a .php file to upload a .zip file into a folder(e.g, myzips,), then to unzip the file in that folder. I can create the folder 'myzips' and upload the .zip file. But the problem is to unzip/extract the file there.:confused:

    Is there anybody who can help me in solving the problem? Green rep will obviously be provided :p
    SEMrush
     
    srobona, Mar 9, 2007 IP
    SEMrush
  2. w8amoment

    w8amoment Well-Known Member

    Messages:
    975
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    If you have cpanel hosting , you can do it via the file manager in cpanel.
    If you click once on the file.zip , top right you'll receive an extract option.
    Works for me...
     
    w8amoment, Mar 9, 2007 IP
    srobona likes this.
  3. srobona

    srobona Active Member

    Messages:
    577
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Thanks for your suggestion. But I want a process(solution in php) to do that. I'm developing a site where user can create a folder(e.g, myfolder), then upload a .zip file there and press submit. Then the uploaded .zip file will be uncompressed in the 'myfolder'. :)

    Can you help me about that? please try :)
     
    srobona, Mar 9, 2007 IP
  4. dc dalton

    dc dalton Active Member

    Messages:
    521
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #4
    dc dalton, Mar 9, 2007 IP
  5. php_daemon

    php_daemon Active Member

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    95
    #5
    If there's zip available on your server, you can run it as an external command:
    
    exec("unzip zipfile.zip");
    
    PHP:
     
    php_daemon, Mar 9, 2007 IP
  6. prudentialwebdev

    prudentialwebdev Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I dont understand either of these solutions, does anybody else have any ideas? I need to upload either an entire directory of files or a zip and then unzip it to a server directory, I cant seem to find a solution short of a content management type deal, thoughts?
     
    prudentialwebdev, Mar 9, 2007 IP
  7. srobona

    srobona Active Member

    Messages:
    577
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    88
    #7
    Do I need server permission to execute a .zip file? Any more suggestion from anybody?
     
    srobona, Mar 11, 2007 IP
  8. tim1

    tim1 Peon

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You cannot execute a zip file.

    Hower you can unzip it with a tool called.... unzip

    An yes, you need server permission to use it. And it has to be on your server of course.

     
    tim1, Mar 14, 2007 IP
  9. dc dalton

    dc dalton Active Member

    Messages:
    521
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #9
    whats so hard to understand, download the php class from the link I provided and use it! I mean it's so well documented it takes about 10 seconds to get it running.
     
    dc dalton, Mar 14, 2007 IP
  10. saidev

    saidev Well-Known Member

    Messages:
    328
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    140
    #10
    saidev, Mar 15, 2007 IP