Working with Zip Archives(Compressing and Extracting) using PHP

Discussion in 'PHP' started by Asif Mallik, Apr 13, 2014.

  1. #1
    Hi everyone! This is Asif Mallik and I am back with another PHP tutorial! In this tutorial I am going to show you how to compress and extract zip files easily using PHP. Hope you are all as excited as I am.



    Make sure to subscribe and share the video with your friends to stay tuned and show your support!
     
    Asif Mallik, Apr 13, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    While the instructions are okay, they don't take into account any of the multiple possible problems one can encounter while working with ZipArchive - I would definitely advise to read http://www.php.net/manual/en/class.ziparchive.php as well. There are quite a few pitfalls one can encounter.
     
    PoPSiCLe, Apr 14, 2014 IP
  3. Asif Mallik

    Asif Mallik Greenhorn

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Well, I did cover the invalid zip error or no file found error.
     
    Asif Mallik, Apr 14, 2014 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Yes, but those are trivial, and not really problems, just processing errors - they should always be handled, regardless. I'm talking about filesystem limits, empty strings, overwrites etc. which behaves slightly different depending on the host system, and so on. I would suggest that you just add a link to the php.net site (the link I provided) and explain that in certain situations, it might be wise to read up on limitations of the filesystem which can affect performance and error-handling - especially since most of these problems are silent - they don't fail the process, they don't return an error, it just silently fails.
     
    PoPSiCLe, Apr 14, 2014 IP
    ryan_uk likes this.
  5. Asif Mallik

    Asif Mallik Greenhorn

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    Like this?
    Before using this class in your project, please check #link# first. There are errors that you may come across.
     
    Asif Mallik, Apr 14, 2014 IP
  6. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #6
    Yeah - that will probably at least provide curious people with the link needed. I'm not usually a fan of video tutorials (I prefer to just have stuff written down), but anyway I think the original source should always be provided, and the official manual pages included - they don't always provide much info, but sometimes especially the comment fields are invaluable.
     
    PoPSiCLe, Apr 14, 2014 IP
  7. Asif Mallik

    Asif Mallik Greenhorn

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #7
    Updated the description. Well, I think it depends from person to person.
     
    Asif Mallik, Apr 15, 2014 IP
  8. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #8
    Ditto, particularly when for some reason I'm not seeing any videos or links in the OP's posts; so I have no clue what's being discussed here... just big blank white areas which likely means whatever/wherever they are hosted is getting chomped by either my AV or my AB. Either that or it's just the buggy idiotic Xenforo method of trying to use iframe with no fallbacks to isolate an HTML 5 video.
     
    deathshadow, Apr 15, 2014 IP
  9. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #9
    I'm guessing HTML5 video-problems - here's the Youtube-link if you want it :D
    https://www.youtube.com/watch?v=aCyWNmeq97A
    Code (markup):
    EDIT: right - automatic rendering of video links... that's just annoying. Youtube and others have an embed-option for a reason (not that it's much better, but still)...
     
    PoPSiCLe, Apr 15, 2014 IP