XF 1.5 Unable to Upload Images

Amaury

Well-known member
I was trying to see if I could reproduce this, only to discover that I can't upload images:

Image Fail.webp

These errors came up in the server error log after trying to upload images failed:

Server Error Log.webp

Code:
Error Info
ErrorException: copy(/home/khflare/public_html/internal_data/attachments/0/531-56e5c8971c1e1c3baa1ccd76a7caafc0.data): failed to open stream: Permission denied - library/XenForo/Helper/File.php:253
Generated By: Amaury, 4 minutes ago

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'copy(/home/khfl...', '/home/khflare/p...', 253, Array)
#1 /home/khflare/public_html/library/XenForo/Helper/File.php(253): copy('/tmp/phpDJqRJF', '/home/khflare/p...')
#2 /home/khflare/public_html/library/XenForo/DataWriter/AttachmentData.php(265): XenForo_Helper_File::safeRename('/tmp/phpDJqRJF', '/home/khflare/p...')
#3 /home/khflare/public_html/library/XenForo/DataWriter/AttachmentData.php(224): XenForo_DataWriter_AttachmentData->_moveFile('/tmp/phpDJqRJF', '/home/khflare/p...')
#4 /home/khflare/public_html/library/XenForo/DataWriter/AttachmentData.php(144): XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/phpDJqRJF', Array)
#5 /home/khflare/public_html/library/XenForo/DataWriter.php(1423): XenForo_DataWriter_AttachmentData->_postSave()
#6 /home/khflare/public_html/library/XenForo/Model/Attachment.php(539): XenForo_DataWriter->save()
#7 /home/khflare/public_html/library/XenForo/ControllerPublic/Attachment.php(204): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 5)
#8 /home/khflare/public_html/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Attachment->actionDoUpload()
#9 /home/khflare/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/khflare/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}

Request State
array(3) {
  ["url"] => string(106) "http://www.kh-flare.net/attachments/do-upload.json?hash=c6cfedd817a1b7a9d145130a68b3b67b&content_type=post"
  ["_GET"] => array(2) {
    ["hash"] => string(32) "c6cfedd817a1b7a9d145130a68b3b67b"
    ["content_type"] => string(4) "post"
  }
  ["_POST"] => array(7) {
    ["Filename"] => string(13) "Crash (3).png"
    ["_xfNoRedirect"] => string(1) "1"
    ["content_data"] => array(1) {
      ["thread_id"] => string(4) "1464"
    }
    ["_xfResponseType"] => string(4) "json"
    ["_xfToken"] => string(8) "********"
    ["_xfSessionId"] => string(32) "20cbfec0b022ced3dff7c77e2f55ba94"
    ["Upload"] => string(12) "Submit Query"
  }
}
 
This indicates that the permissions on the internal_data/ (and possibly the data/) directories are not correct. Given this error, it's likely that you will need to recursively chmod them 0777.
 
Top Bottom