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

XF 1.1 Error message on uploading file

Discussion in 'Troubleshooting and Problems' started by Shortie861, Apr 1, 2012.

  1. Shortie861

    Shortie861 Member

    Hi, I have just recently been getting members posting that they are getting an error message when trying to upload a file to a thread, this has started happening in the last week or so as I used this feature a couple of weeks ago and had no problems.

    The error I get is

    The following error occurred
    There was a problem uploading your file
    Any help is greatly appreciated. Thanks.

    Edit: Also tried changing my avatar and I get this error message

    imagejpeg() [function.imagejpeg]: gd-jpeg: JPEG library reports unrecoverable error:
    XenForo_Application::handlePhpError() in XenForo/Image/Gd.php at line 208
    XenForo_Image_Gd->output() in XenForo/Model/Avatar.php at line 131
    XenForo_Model_Avatar->applyAvatar() in XenForo/Model/Avatar.php at line 69
    XenForo_Model_Avatar->uploadAvatar() in XenForo/ControllerPublic/Account.php at line 482
    XenForo_ControllerPublic_Account->actionAvatarUpload() in XenForo/FrontController.php at line 310
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    XenForo_FrontController->run() in /home/chataddi/public_html/index.php at line 13
  2. Floris

    Floris Guest

    Are there any errors recorded in the log? (Admin CP -> Tools -> Server Error Log)

    Also, check the permissions on internal_data/ and data/ folders, they should be 777 so it can write to it.

    Can you upload using the normal uploader (in other words: does it only error with the flash uploader?)
  3. Shortie861

    Shortie861 Member

    Hi there, yes I have quite a few errors in the error log in the admincp.

    I have checked the permissions on both folders and both are set as 777

    How would I change from uploading from the flash uploader to the normal uploader?

  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Are you able to upload the same image to this forum? Maybe it's a problem with the image itself, like an incorrect file extension.

    Admin CP -> Home -> Options -> Attachments -> Use Flash Uploader
  5. mrGTB

    mrGTB Well-Known Member

    You said everything worked fine before, have you recently upgraded your forum or moved server host, even changed plan? This to me sounds like a chmod issue again with folders and files using 777 permission instead of 755 for folders and 644 for files. But, you say all was working OK until last week, hence asking have you done a recent forum upgrade maybe.

    About your members avatars, when you try and upload a new avatar does it get uploaded OK, but then doesn't get displayed? Or was this problem solved using the normal up-loader instead of flash one Jake said?
  6. Shortie861

    Shortie861 Member

    The last forum upgrade I did was around a month ago and I haven't had any problems until now with any of these.

    I have disabled the flash uploader and the avatars seem to upload fine when I do that but when I enable it again it will upload but appear as a broken image, when the flash uploader is disabled and I attempt to upload a file to a thread or post I am still getting the error and I also get the error when it is enabled.

  7. mrGTB

    mrGTB Well-Known Member

    Sounds like your having the same chmod issue I had before this, but can't see why if you've not changed chmod permissions since and all was working fine previously. But what your saying how your able to upload avatars, but they show as broken images is exactly the problem I had before. Basically, I had to change folder chmod permission from 777 to 755, then change files and images given 777 permission to 644. That's in both "data" and "internal_data" folders, plus these sub-folders inside them (attachments and avatars).

    This thread may help out. http://xenforo.com/community/threads/cannot-upload-file-images.23909/

    This one can shed some light (maybe) also: http://xenforo.com/community/threads/error-being-generated-lots-of-times.23350/
  8. mrGTB

    mrGTB Well-Known Member

  9. Shortie861

    Shortie861 Member

    Thanks for those. I have now changed all chmod for folders to 0755 and for the files to 0644 but still getting the same error when I have the flash uploader turned on.

    I did read the part you stated about the line in the config.php file and after checking that file I don't seem to have this line in there

    $config['chmodWritableValue'] = 0755;
  10. mrGTB

    mrGTB Well-Known Member

    Change that to 644 for testing, I did otherwise all "files" uploaded will be given 755 and not 644 which never get uploaded or created extra later once having complete forum folder structure in place. Think about it, only folders are set to 755, not files and images.

    Also, read the part were Brogan talked about running the Cron job after.
  11. Shortie861

    Shortie861 Member

    I have added that line in now to the config.php file and changed it to 0644 and that seems to have fixed the problem with avatars however I am still having a problem with attachments being uploaded. I have just tried to upload a normal gif image for an attachment and I am getting the error 'There was a problem uploading your file'

  12. mrGTB

    mrGTB Well-Known Member

    Read posts 6, 7, 8 in this link talking about running the cron job manually afterwards when coming to fixing attachments. http://xenforo.com/community/threads/cannot-upload-file-images.23909/#post-294071

    Keep in mind there are two attachments folders (unlike avatars) in both "Data and Internal_Data". Not sure if I just deleted all attachments from both folders (ie sub-folders inside them) in the end, ran the cron job manually, then started fresh trying to upload an attachment with 644 used in config.
  13. Shortie861

    Shortie861 Member

    How would I go about running the cron tasks manually? Is there a specific one that runs for attachments?

  14. mrGTB

    mrGTB Well-Known Member

    admincp/tools/cron entries/

    then in control tab drop-down under "Daily Clean Up" choose "Run".

    I edited my post above to after reading the avatar thing was now fixed, talking more about the attachments to fix that, double check what I said about there being two attachment folders, unlike avatars your dealing with two folders now. Also go back to trying flash uploader, that shouldn't be an issue using it.
  15. Shortie861

    Shortie861 Member

    When you say deleting the attachments from the two folders do you mean the files inside




    and then run the cron task?
  16. mrGTB

    mrGTB Well-Known Member

    Yes, just remove everything (bar the index.html) files from inside both folders and (sub-folders), then run the clean-up cron job and try uploading something again making sure first both are using 755 folder (and sub-folder) permissions of course, not 777.

    Make a backup first of those folders with files inside just in-case.
  17. Shortie861

    Shortie861 Member

    That seems to have worked for the attachments :)

    Would the same process work for avatars aswell? Reason I am asking is I seem to be encountering the problem again after I thought it had been fixed yesterday.

  18. mrGTB

    mrGTB Well-Known Member

    It's worth doing removing all the avatars stored, delete them all from every folder and start again from fresh. But your members will then have none. I would make a backup of the avatar folder first just in case.

    Another thing that might be worth trying, download the whole avatar folder from your server to PC via FTP, delete it on the server and then re-upload the folder again to it. By default folders should be given 755 and images 644 during FTP upload, then see if avatars already stored and listed work OK. If still no, I would delete them all and run the daily clean-up cron job manually. But I'm not sure if that works with avatars like attachments.

    I'm not sure also with avatars if your members would have to "remove them from their profile"? Otherwise they still could be listed as having one, but avatar is no longer present stored on server.
  19. mrGTB

    mrGTB Well-Known Member

    When you said it was fixed yesterday, was that because you created a new test account and uploaded an avatar that worked OK for that account getting displayed, does it still get displayed OK for that new account?

    What exactly went wrong again later?
  20. Shortie861

    Shortie861 Member

    I tested it using a new account and using my account and all seemed to be working but once I went back to check it again today I was getting the error again.

    Since deleting the files out of the folders, checking the chmods and then manually running the clean up it all seems to be working now with no problems from members.

Share This Page