Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Just wanted to let you know that I managed to find a way to do this by using a callback function from PclZip.

    $properties = $zip->create($files, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_CB_PRE_ADD, ‘my_callback_pre_add’);

    You specify a function that is called before adding a file and within that function you can manipulate the stored filename.

    Hi,
    I have a question as I had a smiliar problem and also “hacked” the original code in order to fix it. I was also trying to allow users to download image files in a higher resolution.
    But I made use of the fact, that the original files are kept as *.jpg_backup and I amended the code, so that these were downloaded instead.

    I recently updated to a newer version of download gallery and for some reason I did not save my older modified version.

    Then I read about the filter you added and thought “Even better, this way I won’t have to worry about updates in the future”.
    But now it seems to me, that I can change the path of the files to be zipped (including the name), but I cannot give them a different name to be used within the zip.
    Obviously I don’t want them to have the extension .jpg_backup, but just .jpg. It seems that the zip library that is being used now does not give you the option to give a separate filename in the archive.

    Is there any way around this?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)