• Resolved Nadir Latif

    (@nadirlatif-1)


    I was not able to upload images to a photo gallery. It was giving the error: “There has been a problem while trying to upload the following images. Please try to upload them again.”. I am using the latest version of the Photo Gallery plugin.

    I checked using Chrome developers toolbox and it showed 500 internet server error for the ajax call: bwg_UploadHandler. I checked the code of filemanager/UploadHandler.php, which was handling the ajax call. I used Php print and echo commands to locate the error. It turned out the problem was in the function set_file_info. The function was not handling the case where an image has no credit, aperture, camera, caption, iso, copyright or tags. So if an image has an empty value for one of these properties, then the ajax call fails. I updated the function set_file_info so it checks if the file properties are present. That fixed the error. I was able to upload images. Here is the updated code for set_file_info:

    /**
       * Set file info.
       *
       * @param $info
       * @return mixed
       */
      private function set_file_info( $info ) {
        $data['is_dir'] = 0;
        $data['path'] = $info->path;
        $data['type'] = $info->type;
        $data['name'] = $info->name;
        $data['filename'] = $info->filename;
        $data['alt'] = $info->alt;
        $data['thumb'] = 'thumb/' . $info->name;
        $data['size'] = $info->size;
        $data['resolution'] = $info->resolution;
        $data['credit'] = iconv_mime_decode($info->credit);
        $data['aperture'] = iconv_mime_decode($info->aperture);
        $data['camera'] = iconv_mime_decode($info->camera);
        $data['caption'] = iconv_mime_decode($info->caption);
        $data['iso'] = iconv_mime_decode($info->iso);
        $data['orientation'] = $info->orientation;
        $data['copyright'] = iconv_mime_decode($info->copyright);
        $data['tags'] = iconv_mime_decode($info->tags);
        $data['date_modified'] = date('Y-m-d H:i:s');
        return $data;
      }
    

    Please fix this issue and update your plugin. Thanks

    • This topic was modified 5 years, 9 months ago by Nadir Latif. Reason: entered the topic tags

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    Thanks for the detailed info.

    We will include the fix in our upcoming update.

    Have a nice day!

    • This reply was modified 5 years, 9 months ago by Suzie.
    Plugin Support Kima Baghdasaryan

    (@kimabaghdasaryan)

    Hi,

    We would like to kindly inform you that we have updated the Plugin on Friday and the fixation is included in this version.

    Thank you!

    Have a nice day!

    I just updated to the latest version (1.5.17) and still seem to have this or similar problem. 500 error on upload. Some images upload and some don’t. On the ones that do upload, some have no thumbnail created and some do. Web Inspector shows error during action=bwg_UploadHandler. All files seem to have EXIF info.

    Plugin Support Kima Baghdasaryan

    (@kimabaghdasaryan)

    Hi,

    Have you tried to upload the failed images separately? Please try to upload failed images separately. Probably, the issue is related to the images, i.e. the format of these images may be damaged or too large.

    Thank you!

    Have a nice day!

    Having the same issue and it won’t work with 1 or more images. Any suggestions?

    We get: There has been a problem while trying to upload the following images. Please try to upload them again.

    Plugin Support Kima Baghdasaryan

    (@kimabaghdasaryan)

    Hi,

    Please navigate to photo-gallery/filemanager/view.php file, and search for display function (approximately line 305) and set up limitConcurrentUploads to 1

    limitConcurrentUploads: 1, // upload step by step

    Please check the following screenshot.

    Otherwise, please try to upload large resolution (more than 10 MB) images separately.

    Thank you!

    Have a nice day!

    This hasn’t worked for us.

    Plugin Support Kima Baghdasaryan

    (@kimabaghdasaryan)

    Hi,

    1. We are kindly asking you to provide PHP error log. You can contact your hosting server’s support and ask them to provide this information.

    2. Please send to us one of the images which you are trying to upload but with no luck.

    3. Also, please upload this same image to Media of your WordPress Dashboard and see if it is uploading.

    Thank you!

    Have a nice day!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cannot upload images’ is closed to new replies.