Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 8 of 8

This is a discussion on Zipping Files? in the Shared & Semi-Dedicated forum
Is there a quick little way to zip files? I am trying to write a script that will allow a user to select a bunch ...

  1. #1
    JPC Member
    Join Date
    May 2002
    Posts
    20

    Zipping Files?

    Is there a quick little way to zip files?

    I am trying to write a script that will allow a user to select a bunch of photos and then have them zipped to one file for download.

    Can someone show an example? I assume some form of a zipping function is already installed on the servers?

    Michael

  2. #2
    Ron
    Guest
    What language are you planning on using to accomplish your overall task?

  3. #3
    Ron
    Guest
    Well, I thought you might be online for a fast turnaround dialogue.

    Standard Unix utilities are available to your scripting language, and there are extensions to the languages available, too.

    In unix, you can try something like "gzip -c pic1.jpg pic2.gif pic3.bmp > downloadfile.gz"

    But unless you have a homgeneous population of users, you're likely going to have compatibility problems on your clients' PCs. I don't have a complete answer for you, I haven't ever found the need to do anything like this before, though I see the utility in it.

    If compatibility is going to be an issue for you, you might want to search around on the web and see if there's a ready made solution that will provide your clients with choice of format.

    Maybe someone else around here has done a similar thing.
    Good luck!

  4. #4
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    Here is a link that shows how to create ZIP files using PHP:

    http://www.planet-source-code.com/vb...d=957&lngWId=8

    Hope it helps.
    Randy

  5. #5
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    There is a program on the servers called "zip" that makes PK-ZIP compatible ZIP files that most Windows (and Mac) users will be able to use. (Find it at /usr/bin/zip along with its sister program /usr/bin/unzip for unzipping.)

    I've done some extensive work with calling these programs from PHP (albeit it was with PHP3 when I did it). I'm willing to pull out my old code to provide examples if you'd like.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  6. #6
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    Just SSH'd into my account on carbon and zip doesn't exist. I'm thinking it is because of the jailshell. unzip works fine. Maybe it's just the server I'm on?

    Randy

  7. #7
    JPC Member
    Join Date
    May 2002
    Posts
    20
    Thanks all. I think I have come up with a sollution.

    If I find it isn't working I would be interested in that example.
    Thanks,
    Michael

  8. #8
    JPC Guru
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    389
    Well, I just thought of you and looked for something. Maybe if your solution doesn't work out, you can give this a try.

    Net2FTP v0.6

    New IN v0.6: zip and download (1 select files; 2 press the Zip button; 3 download a zip archive containing those files)
    Even if you don't want to use the program, you can at least see how they do it.

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
  •