1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unexpected error occurred while uploading file

Discussion in 'Media Gallery Support' started by Ladegro, Jul 5, 2015.

  1. Ladegro

    Ladegro Member

    Just upgraded to ZFMG 1.0.6 but still I'm getting the following error while trying to upload image file into a category:

    upload_2015-7-5_9-56-14.png

    I also happens if I try just one file (I need to upload a total of 1,2GB at the end). I'm not seeing any error-logs in the admin panel and do now know where to look further for more info, but as we need this album to be live for an event, this timing is - as most times with errors :) - terrific...

    Does anyone have a clue?

    B.t.w. it's not because of limitations: upload_2015-7-5_9-59-40.png

    I have unlimited server storage.

    Edit:

    After resizing images to less than 1MB each, I can succesfully upload them indeed.
    But now I'm getting the following error when I try to hit the Save button:
    upload_2015-7-5_11-32-9.png

    I'd kindly chmod the right directory to fix this but I'm not sure where to look?
     

    Attached Files:

    Last edited: Jul 5, 2015
  2. Chris D

    Chris D XenForo Developer Staff Member

    I believe it is failing this check:

    PHP:
    if ($file->isImage()
       && 
    XenForo_Image_Abstract::canResize($file->getImageInfoField('width'), $file->getImageInfoField('height'))
    )
    Assuming that it is a valid image file being uploaded, it must be failing on the 'canResize' check.

    XenForo has a config setting named maxImageResizePixelCount. It defaults to 20,000,000.

    First, check if you have changed that in your config.php file. If you haven't then it suggests that the images you're uploading are pretty huge - over 20 megapixels.

    As long as your server has sufficient resources and limits to be able to handle large images, the simple thing to do would be to add something like this to config.php:

    PHP:
    $config['maxImageResizePixelCount'] = 30000000;
    That would allow you to support uploading and resizing images over 30 megapixels.
     
  3. Ladegro

    Ladegro Member

    Where can I find the config.php file?
    After I resized the images to normal sizes, the initial upload goes ok, but then it hangs on the second error (see the edit). The smaller version I'm uploading are definately smaller than 20mpix...
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    On the server in the /library directory.
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    That isn't a directory permissions error, I don't think.

    The only directories you need to ensure are fully writable along with their sub directories and files are data and internal_data (same as XenForo). Make sure these are writable in the first instance.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    It could also be a mod security issue - you can contact your host to see if any rules are being triggered.
     
  7. Ladegro

    Ladegro Member

    Indeed, the apache error log shows the following:
    Do you have a suggestion what to do about this?
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Contact your host and explain the problem and they should be able to whitelist the offending rule.
     
  9. Ladegro

    Ladegro Member

    ok thanks.
     

Share This Page