printDownloadAlbumZipURL does not seem to support $conf['album_folder_class'] = 'external'

Hallo!

When defining the album folder class option to "external" with the correct full path $conf['album_folder'], the zip file generated by printDownloadAlbumZipURL contains all the files structure but with 0 bytes. It looks like it cannot access to original files. Permissions are all OK (www-data + ).

I do not find any logs about this error.

Is it a bug or a feature request ;-) ? Any ideas?

Thanks

Comments

  • acrylian Administrator, Developer

    Just quickly tried locally with an external albums folder one level above the webroot and it worked for me (58 MB file).

    Did you look in all logs incl. the PHP server error log? Without an error I have no idea. How large is the album you tried? Although the zip stream librarry we use should help with large files, it is quite memory heavy task if the album is very large with lots of large images.

  • acrylian Administrator, Developer

    @fretzl however could reproduce it. Now we need to find out what's the difference.

    So far I can only reproduce that it does not work if you create the zip from cache (meaning default sized images) but that is independent from external or not.

  • 1/ I have upgraded all php settings
    php_value memory_limit 1024M
    php_value upload_max_filesize 1G
    php_value post_max_size 1G
    php_value max_execution_time 600
    php_value max_input_time 1000
    php_value max_file_uploads 20
    2/ I have tested with one small image in an album and it is not a memory issue.
    3/ I have no error in php logs and apache error
    4/ I have also noticed that the cache option does not work too
    5/ Folder Zip works when the folder settings are
    $conf['album_folder'] = '/albums/';
    $conf['album_folder_class'] = 'std';
    Download is progressive and zip file is correct.

    6/ It does not work when I just switch to
    $conf['album_folder'] = '/full_path_of the server/albums/';
    $conf['album_folder_class'] = 'external';

    Zip file is correctly generated with all the files but with 0 bytes size. This happens with from the album (downloadList_zipFromCache) option in the extension settings..
    It looks like it is a zip stream issue as it may not find the original files location (curl issue) ?

  • My environnement is PHP Version 7.3.14-1~deb10u1

  • acrylian Administrator, Developer

    Just to be sure: Did you really set the correct external path?

    I just tried on your test install on our own server (it's pretty standard hosting and nothing special like our own full server or something) with an external folder right above the webroot of the test (sub)domain. All domains are organized in their own folder on the server.
    All works as expected here…

  • Yes I did.

    I followed instructions:
    'external' -- the folder must be a full server path to the album folder.
    // Images within an external folder are not visible to web
    // browsers, so certain features such as flash players cannot
    // display them

    I have tried with and without ending slash, folder is just right above the web root too.

    $conf['album_folder'] = '/home/www/www.arnoult.com/albums/';
    $conf['album_folder_class'] = 'external';

    $conf['album_folder'] = '/home/www/www.arnoult.com/albums';
    $conf['album_folder_class'] = 'external';

    Path is correct as Zenphoto finds data correctly as I have tested publication of new photo in this external folder too.

    Is there a way to log all PHP messages (warning, information + errors)?

  • acrylian Administrator, Developer
    edited April 2020

    The trailing slash is required actually (at least it does not work without here).

    Is there a way to log all PHP messages (warning, information + errors)?

    ZP will log most it can in its debug log. There might be stuff that isn't which then should be in the PHP server log. How you enable that and where it is located depends on your host, sometimes via htaccess, sometimes via PHP and on some you specifially have to enabel a log on the host backend.

    Also ask you host if there is any limitation to the folders above the webroot.

  • acrylian Administrator, Developer

    Since all domains are in another subfolder here (originally the server was shared with non zp stuff), I moved the folder even one level up. Also works for me.

  • acrylian Administrator, Developer
    edited April 2020

    We also tried various extra files like video, audio plus sidecars. All works as expected here on our server. Sorry, unless you can come up with an actual error or an secure way to reproduce the failure, I fear I cannot help.

    If the album you tested is very large try one with just a few images to be sure it isn't something like that.

  • @acrylian Thanks for your time investigating. Without any clue, I will leave it as std folder.

  • acrylian Administrator, Developer

    Okay, it is really strange. It works locally and on our own live server but not on the live server of @fretzl. So far we have no clue why that is as there are also no errors.

  • fretzl Administrator, Developer
    edited April 2020

    There is a fix for this issue so please try the Support build. However, zip dowloads "from cache" are not working yet.

  • fretzl Administrator, Developer

    The download now also works for images "From cache" if the correct image sizes are indeed cached. Please try the Support build.

  • Hallo @fretzl I have tested the latest support build and it is now working for me as expected, YES!

    Thank you for your great support, this is awesome.

Sign In or Register to comment.