albumZipStream

Hi,

I wrote a little plugin that is able to create zip-files on the fly while streaming them. Other than that the functionality is the same as Zenphoto's album-zip.

Advantage over the built in functionality is, that download starts immediately. You don't have to wait for zip file to be created before it is sent, but unlike using persistent archives it is always up to date.

There is a small drawback though. As the zip-file is still being created while getting sent, there won't be a filesize given. So resuming the download and estimated time till completion inside your browser/download manager won't work.

Requirements:
PHP 5.1.2 is required and safe mode = off is strongly recommended as timeouts may appear for large albums with safe mode enabled.

Usage:
just download from the link provided below and unpack the zip-file into your plugins folder.
enable the plugin.
and add the following line into your album.php, whereever you want the download-link to appear:

`printAlbumZipStream();`

Download:
https://sourceforge.net/projects/albumzipstream/

Comments

  • acrylian Administrator, Developer
    Thanks, new plugins are always welcome. But please create a page with some info we can link to from our extensions section. We don't like to directly link to 3rd party tools as that looks as if it is by us and linking to a forum post is not that good as well. Please see:
    http://www.zenphoto.org/news/general-contributor-guidelines#themes-and-plugins
  • ok. I created a SF-project under:
    https://sourceforge.net/projects/albumzipstream/

    not much information on it yet, though.
    I'll add more, when i've a little bit more time.

    Could you please edit the download-link in my first post so it points to the sourceforge project?
    Thanks.
  • acrylian Administrator, Developer
    Thanks, that's better and even easier for you regarding possible updates.

    I will edit the link and also add an entry to our extensions section.
  • fxk Member
    Hi,

    I have problems with this plugin ...
    I dropped it into the plugins folder but it doesn't show up on the plugins list - weird.

    Why could that be?
    Cheeers
    hein
  • check to be sure that you did drop the plugin into the folder correctly. There should be the main file in the root of the folder. Probably it is not there, otherwise you would get something displayed.
  • fxk Member
    Hmm - I didn't think, there are so many ways of dropping a file somewhere ;)

    I did everything again just now and realized, that the plugin consists of the plugin-php file PLUS an extra subfolder. Both these elements need to go into the "plugins"-folder ....

    got it, thanks
  • fxk Member
    Ok, new problem ;)
    I activated the plugin and included the link in my skin, easy.

    When I click the link "Download a zip file of this album" in the album "test"(just like i want it) the download begins and I get a zip file named "test.zip", size is 5.7 MB which makes sense.

    Problem:
    When I unzip the file I strangely get a new file named "test.zip.cpgz"

    Various tools can't explain me, why and what this is ...
    Any ideas from your side?

    Thanks
    hein
  • After some googleing I found out that there are lots of entries regarding .zip files becoming .cpgz on Mac OSX using the default Mac unzipper.

    could you pls confirm that you're using OSX and unzipper?
    If so, I might have a solution for this and try to do some code changes tonight.
  • fxk Member
    Hey - great.
    yes, I'm on Mac OS X 10.6.
    For unzipping I tried
    * the default "Archive Utility", result: *.cpgz
    * Stuffit Expander, result: Error Message: "An error occurred attempting to expand {/*/*/*/}test.zip - The structure of the archive is damaged. (Error #17540)"

    that's it.

    Thanks a lot!!!
  • Ok. I've implemented a small change, that will hopefully fix your bug. I'm not able to verify though as I don't have a Mac to try the fix.

    Please download the fix from:

    http://sourceforge.net/projects/albumzipstream/files/test/albumZipStream-Fix_OSX.zip/download

    replace the files and report back.
  • fxk Member
    Thanks for your effort,
    but sorry - still the very same effect.
  • not what i was hoping to hear...

    I have uploaded some sample zip-files to:

    https://sourceforge.net/projects/albumzipstream/files/test/Sample Zips/

    maybe you can try which of them cause problems on your mac and which, if any, work. That would really help me to narrow down the problem.
  • fxk Member
    Sure!!!

    I checked -
    test.zip -> test.zip.cpgz
    test2.zip -> readme.test
    test3.zip -> readme.test

    I tried a few hours ago on a Ubuntu machine of a friend, just to check and she also couldn't unzip the zip-archive from my homepage. (http://photos.project22.org/test-2/)

    Thanks very much for your assistance. Cheers
  • acrylian Administrator, Developer
    I just tried on Mac OS X 10.7.2 and I could neither expand it with the built in tool nor with "The Unarchiver" that normally gets to open "everything".
  • Thanks. your input and espacially your link are of great help.

    I've uploaded another build to:

    http://sourceforge.net/projects/albumzipstream/files/test/albumZipStream-Fix_OSX.zip/download

    which will hopefully fix the problem.

    Edit: just for those interested in technical info:

    there were 2 problems.
    1. the header of the zip caused problems on mac as the zip told to be made on OS2/HPFS filesystem, which OSX seems to have problems with.
    2. there was a possible php notice thrown which was prepended to the zip and thus causing the zip file to be invalid.
  • seems i've missed a notice.
    fixed and hopefully working version now:
    http://sourceforge.net/projects/albumzipstream/files/test/albumZipStream-Fix_OSX.zip/download
  • fxk Member
    YEAAAAH
    now it worked.

    Many many thanks from here for your efforts in making this a very useful plugin. Great

    THANKS
    Hein
  • Nice to hear. You're welcome.
  • I have installed this plugin and added the printAlbumZipStream(); to my album.php... it shows up just fine... the issue originally was a gettext() call to undefined..... I recompiled apache with gettext which solved that issue, now the issue I have is that when you hit the link I get the url as 404 not found. The url is actually strange as it is domain.com/plugins/zp-core/setup.php?autorun=gallery . Not sure why it is looking for zpcore folder in the plugins folder to begin with.... You can see y example on this test site....http://boatsandho.es/index.php?album=test3/ it is the second download zip link as the first is a another test and failing with the native print album zip
  • acrylian Administrator, Developer
    Since you changed your server configuration setup wants to run. Just run it. Please see the info on the install page about this.
  • Thank you. That was the issue exactly.
  • Sorry I spoke too soon, that is not the solution. The issue still persists every time I select the link it gives me a url as such http://boatsandho.es/plugins/zp-core/setup.php?autorun=gallery not sure why.
  • acrylian Administrator, Developer
    If you are using hte static html cache make sure that is cleared as well as your browser cache.
  • This error just cropped up for me too (possibly started in the last month, been a while since I had a major update to a gallery that'd prompt downloads).

    Emptied both caches (static HTML and browser), even turned off caching and went to a different browser.

    The only recent change I had was this week I upgraded PHP and it prompted me to re-run the setup.
  • Dang, waited 1 minute too long to edit my post. Ahem. The old printAlbumZip works fine, and I noticed I get sent to /plugins/zp-core/setup.php?autorun=gallery and not just /zp-core etc etc. So... weird.
  • This could be caused by an error somewhere in the "staratup" of Zenphoto. Please review your PHP logs. Most likely we will need both the error and a stack trace of the call history.

    Or a step-by-step set of instructions on how to reproduce the failure.
  • "staratup" ?

    I wish I could tell you how to reproduce, because this is what I know:

    1) It used to work.
    2) As of Wednesday Sept 26th I noticed it wasn't.
    2b) I was 'prompted' to re-run setup on the 26th as well, due to a 'php change'
    3) The only change I made was upgrading PHP on/around that week.

    I don't know when it actually broke, and I don't know how to reproduce it except to say it's busted on my site :/

    I upgraded to 1.4.3.3 just now, same thing.

    Setup log:

    Zenphoto Setup v1.4.3.3[10902]: Tue, 02 Oct 2012 13:08:24 -0500

    Warn: We strongly recommend disabling magic_quotes_gpc. [...]

    Warn: If file permissions are not set to strict or tighter there could be a security risk. [...]

    Warn: Setup did not perform a test of the filesystem character set. [...]

    Warn: MySql Version 5.0.0 or greater is required. Version 5.5.0 or greater is preferred. Use a lower version at your own risk.

    Setting permissions (0666) for Zenphoto package.

    Warn: Setup could not set the one or more components to the selected permissions level. You will have to set the permissions manually. See the Troubleshooting guide for details on Zenphoto permissions requirements.

    Notice: failed setting permissions (0666) for albums.
    Notice: failed setting permissions (0666) for cache.
    Notice: failed setting permissions (0666) for cache_html.
    Notice: failed setting permissions (0666) for plugins.

    Debug log in Zenphoto has nothing about anything.

    Error log on PHP has nothing about zenphoto.

    If you look at `http://jorjafox.net/gallery/tv/csi/pub/s13/candid/` you'll see two links.

    http://jorjafox.net/gallery/plugins/albumZipStream.php?albumZipStream&album=tv/csi/pub/s13/candid

    and

    http://jorjafox.net/gallery/tv/csi/pub/s13/candid/http://jorjafox.net/gallery/tv/csi/pub/s13/candid/?download=tv/csi/pub/s13/candid&albumzip

    The first one always takes me to http://jorjafox.net/gallery/plugins/zp-core/setup.php?autorun=gallery and is using albumZipStream

    I'm happy to provide anything I can :)
  • `albumZipStream` is supplied by one of our users. Best guess (without looking) is that it needs to be updated for the current release.

    But you seem to have got your site working using the download list plugin which would be our recommendation anyway.
  • i have the same problem.
    after playing a bit with die die command i found out that after the line "require_once(dirname(__FILE__) . '/../zp-core/functions.php');"
    the "album " variable is overwritten with the value "gallery"

    PHP Version: 5.4.4-7
    Apache Version: 2.2.22-11
    ZenPhoto Version: 1.4.3.2
  • acrylian Administrator, Developer
    Again, albumZipStream is a third party plugin we don't support. The functionality is included in the downloadList plugin. Please try that.
Sign In or Register to comment.