• Everything goes well when I create a new gallery.
    Everything goes well when uploading pictures.

    Then it goes not that well : no problem to display thumbs, but no way to show the “mother pictures”. I found out why. The problem is linked to file permissions.

    Lets say:

    Gallery (folder)
    GalleryTest (folder)
    Pict1
    Pict2
    Thumbs (folder)
    Pict1Thumb
    Pict2Thumb

    Gallery, GalleryTest and Thumbs have necessary file persmissions
    Thumbs pictures have necessary file permissions
    GalleryTest pictures don’t have the necessary permissions and cannot be readed to be displayed.

    Therefore, why don’t the picture files get the required permissions ? How is this handled within WordPress ?

    Someone can help me to understand the process ?

    Thanks.

Viewing 1 replies (of 1 total)
  • Like you, and many others I see, I just had this problem, and could not find a solution in the forums (perhaps a bad keyword search).
    But with some quick digging into the code I think I have the simple solution.

    NextGen uses the PclZip Class that comes with wordpress .
    This is located at /wp-admin/includes/class-pclzip.php

    when NextGen uses this class to unzip the images, a simple parameter/ argument that sets the permissions is omitted.

    To change this go to wp-content/plugins/nextgen-gallery/admin and edit the functions.php file as follows:

    search for ‘function unzip’

    change this line of code from:

    if ($archive->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_CB_PRE_EXTRACT, 'ngg_getOnlyImages') == 0) {

    to:

    if ($archive->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_SET_CHMOD, 0755, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_CB_PRE_EXTRACT, 'ngg_getOnlyImages') == 0) {

    this worked for me, and hopefully it will do the trick for you and others.
    I must say, unless I’m missing something, I’m really surprised this issue has not been fixed in the code ages ago.

Viewing 1 replies (of 1 total)
  • The topic ‘NextGen/Gallery – Problem with file permissions’ is closed to new replies.