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

XF 1.4 Failed to write the attachment file

Discussion in 'XenForo Questions and Support' started by Main Company, Jan 8, 2016.

  1. Main Company

    Main Company Active Member

    Problem start Tuesday of this week, and I have no idea why. I haven't made any changes to the forum since before Christmas. Any thoughts? (Mods, please feel free to relocate if this needs to be posted in bdAttachmentStore addon section)

    Server Error Log

    Error Info
    XenForo_Exception:Failed to write the attachment file. -library/XenForo/DataWriter/AttachmentData.php:145

    Stack Trace
    #0 /var/www/xenforo/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(63): XenForo_DataWriter_AttachmentData->_postSave()
    #1 /var/www/xenforo/library/XenForo/DataWriter.php(1409): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_postSave()
    #2 /var/www/xenforo/library/XenForo/Model/Attachment.php(524): XenForo_DataWriter->save()
    #3 /var/www/xenforo/library/XenForo/ControllerPublic/Attachment.php(201): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 2)
    #4 /var/www/xenforo/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Attachment->actionDoUpload()
    #5 /var/www/xenforo/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #6 /var/www/xenforo/index.php(13): XenForo_FrontController->run()
    #7 {main}

    Request State
    array(3) {
    ["url"] => string(116) "https://discuss.forumdomain.com/att...f7c00bbfd0b1c0efb56ea0296a8&content_type=post"
    ["_GET"] => array(2) {
    ["hash"] => string(32) "3b62ff7c00bbfd0b1c0efb56ea0296a8"
    ["content_type"] => string(4) "post"
    ["_POST"] => array(7) {
    ["Filename"] => string(28) "test.jpg"
    ["_xfResponseType"] => string(4) "json"
    ["content_data"] => array(1) {
    ["node_id"] => string(2) "23"
    ["_xfSessionId"] => string(32) "cd99f4ec9b050e5aa3e3012391b02eb5"
    ["_xfToken"] => string(8) "********"
    ["_xfNoRedirect"] => string(1) "1"
    ["Upload"] => string(12) "Submit Query"
  2. wang

    wang Well-Known Member

    Can you check the AttachmentData.php file of that add on and see if it is present in its location? If it is, can you see what the (chmodd) permissions for that file are set at?
  3. Mike

    Mike XenForo Developer Staff Member

    Where are you storing attachments? You have an add-on that's directly involved so it may well be the culprit.
  4. Main Company

    Main Company Active Member

    AttachmentData.php => Permissions = 644

    Files are stored in /dataX/xenforo/data/yyyy/month_number.

    Looks to me like a folder for 2016 has not been created yet, and come to think of it, I think the last time I was able to successfully upload a file it was still 2015.

    I also just checked older attachment folder permissions...
    /dataX/xenforo/data/ => 755
    /dataX/xenforo/data/2014/ => 755
    /dataX/xenforo/data/2015/ => 777

    Do I need to create the /dataX/xenforo/data/2016/ manually???
    Last edited: Jan 11, 2016
  5. wang

    wang Well-Known Member

    I think it would be better if you asked that add on developer about this.
  6. Main Company

    Main Company Active Member

    Thanks. I posted a link in the Add-on thread to this discussion.

Share This Page