SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    zipping folders on the fly

    I know how to zip a file but what about zipping folders that are not empty? there could be other folders in them as well. would I hav eot open each folder to ge tthe contents out? then if I did that how would it know to zip that folder as well?
    success is not by chance, it is by choice.

  2. #2
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you're talking about using the zip command line tool, you can recursively zip a directory with the -r flag:
    PHP Code:
    system("zip -r outfile.zip foldername/"); 
    Marc Gugliuzza
    marc.gugliuzza.com



  3. #3
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no, not really. I wanted to loop through the directory, no command line
    success is not by chance, it is by choice.

  4. #4
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you want to loop through the directory and zip each file you find into it's own zip file? I don't understand what you're trying to do. You said that you know how to zip a file.. how are you doing it then if not through the command line?
    Marc Gugliuzza
    marc.gugliuzza.com



  5. #5
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can open the file and put the contents in a variable then zip it up. same way phpMyAdmin does it. it is not commend line.

    I want to go through the dirctory and zip it ALL into one file. this directory will have files and folder inside it.
    success is not by chance, it is by choice.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •