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

XF 1.1 Cannot upload file (Images)

Discussion in 'Troubleshooting and Problems' started by mrGTB, Nov 27, 2011.

  1. mrGTB

    mrGTB Well-Known Member

    I've done a clean install of XenForo today, 1.1 final version.

    I cannot upload files (images). I've added the line to config trying both 0755 and 0644. No joy! It becoming extremely frustrating using XenForo of late.

    2.JPG

    Snap1.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Your directory permissions are incorrect.

    I have to say, I also use shared hosting and I don't have any of the problems you have posted about recently.
     
  3. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    The mkdir seems permissions, the other ... there is definitely something wrong, I was having the same issue on a fresh install of XF just today.

    I gave up, I just disabled the flash uploader in the options, it defaults to the form html upload. It works fine now for me. Does the flash uploader do temp upload somewhere?
     
  4. mrGTB

    mrGTB Well-Known Member

    There's something wrong here. OK, I managed to get images uploading now. The problem was I changed this line from 0755 to 0644 in the config.php file.

    When at 0644 in config, I didn't first spot it created an attachment folder in "internal_data" with 0644 permission, so XenForo couldn't write to it (upload to it) obviously. I solved that problem by deleting attachment folders in internal_data and data folders, changed chmod permission in config back to 755 and uploaded image again (worked fine). But there is another problem here going on. When I delete the image from forum and then check those two attachment folders. They are still there, they have not been deleted from the folders (even using 0755 permission on them).

    Another issue you have going on here. If you set that setting in config.php to 0755 during installation, it's setting index.html files, config.php, install_lock.php and a ton of other stuff to 0755 permission which is just plain wrong. It's even setting JPG avatar images as 0755 when they only need to be 644 permission.

    You've got a real mixed bag of permissions taking place here on files that should only be going to folders at 755 permission. But the worst thing is, if I wasn't adding that line in config.php set at 755 permission - instead it would be setting everything as 777 permission. Your forcing permissions on other files that don't need to be set at that permission. And on some servers using cPanel this will cause internal server errors using 777
     
  5. mrGTB

    mrGTB Well-Known Member

    An update, if I remove that permission line from the config.php file and let XenForo create attachment folders with 0777 permission, along with all files located inside them e.t.c (default as should be). When you delete an attachment from a thread it still remains there in the attachment folders.

    That seems odd, because if I delete an avatar using folders with 755 permission and image using 644 permission. The avatars are still deleted from the avatar folder on the server. Tried exactly the same permission set-up with attachments folders and files (same as avatar folder and image files). Yet still, attachments don't get deleted from server. Tried all sorts of different ways now using many different permission methods. Always the same story - attachment files remain on the server not deleted.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Attachments are removed via a routine cron task, not immediately.
     
  7. mrGTB

    mrGTB Well-Known Member

    Right, I wasn't aware of that. OK, I'll set-up folder permissions same as Avatar folder and files, upload image to thread and then delete it, then run the cron task manually and see what happens.
     
  8. mrGTB

    mrGTB Well-Known Member

    Your correct, the hourly clean-up process removes attachments from those two folders located in Data and Internal_Data.

    As things stand now then, all folders use 755 permission and files use 644 (except "File Cache" files being given 0666 auto) by server I set-up. I've now changed the line in the config.php by the way, from 0755 to 0644. Reason being, that 0755 permission was only needed at first to create the folders required for uploads like "Avatars and Attachments", they still need 0755 permission at least to be able too write files to them. Once they are there in place though, you can actually change the permission from 0755 to 0644 in the config.php file and all future uploaded avatar images and attachment files will be given 644 instead of 0755 located in those folders.

    During the installation though you don't have a config.php file, it gets created when you install XenForo, so folders and files at first are given 0777 until you add that line to config.php to override that chmod permission. That did mean I had to manually change permission on files and folders after first installing using FTP - changing files from 777 to 644 and changing folders from 777 to 755.

    In short, all folders have 0755 - all Files have 0644 chmod permission. Except for just the DATA CACHE I set-up with files being set at 0666 by server
     
  9. tocheli

    tocheli Member

    Have the same problem:
    [​IMG]
    • fresh installation
    • normal upload works,
    • flash upload works not. (tested with ie8 & firefox 21)
    i need the multi imiges upload feature of the flash uploader because i have posts with reports up to 50 images. my members does not like to upload every picture by it owns! :(
    some suggestion what's the problem.
     

Share This Page