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

XF 1.2 Can't Upload Images

wickedstangs

Well-known member
#1
I just upgraded to 1.2.3 and now I can't upload images..

Code:
ErrorException: copy(/home/********/public_html/community/internal_data/attachments/6/6211-402105c99f3eaaa1d1c646f25fe8650d.data) [<a href='function.copy'>function.copy</a>]: failed to open stream: Permission denied - library/XenForo/Helper/File.php:217
Code:
#0 [internal function]: XenForo_Application::handlePhpError(2, 'copy(/home/*****.', '/home/*****/...', 217, Array)
#1 /home/*****/public_html/community/library/XenForo/Helper/File.php(217): copy('/tmp/phpZWPpmM', '/home/*****/...')
#2 /home/*****/public_html/community/library/XenForo/DataWriter/AttachmentData.php(264): XenForo_Helper_File::safeRename('/tmp/phpZWPpmM', '/home/*****/...')
#3 /home/*****/public_html/community/library/XenForo/DataWriter/AttachmentData.php(223): XenForo_DataWriter_AttachmentData->_moveFile('/tmp/phpZWPpmM', '/home/*****/...')
#4 /home/*****/public_html/community/library/XenForo/DataWriter/AttachmentData.php(143): XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/phpZWPpmM', Array)
#5 /home/*****/public_html/community/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_AttachmentData->_postSave()
#6 /home/*****/public_html/community/library/XenForo/Model/Attachment.php(524): XenForo_DataWriter->save()
#7 /home/*****/public_html/community/library/XenForo/ControllerPublic/Attachment.php(201): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 1)
#8 /home/*****/public_html/community/library/XenForo/FrontController.php(337): XenForo_ControllerPublic_Attachment->actionDoUpload()
#9 /home/*****/public_html/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/*****/public_html/community/index.php(13): XenForo_FrontController->run()
#11 {main}
Code:
array(3) {
  ["url"] => string(136) "http://www.wickedstangs.com/community/attachments/do-upload.json?hash=0341b7fe10b72b3a9125c7544d0deb54&content_type=conversation_message"
  ["_GET"] => array(2) {
    ["hash"] => string(32) "0341b7fe10b72b3a9125c7544d0deb54"
    ["content_type"] => string(20) "conversation_message"
  }
  ["_POST"] => array(7) {
    ["Filename"] => string(14) "evo_STANG6.jpg"
    ["_xfToken"] => string(8) "********"
    ["content_data"] => array(1) {
      ["conversation_id"] => string(5) "11477"
    }
    ["_xfResponseType"] => string(4) "json"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfSessionId"] => string(32) "3f82c1996e72706984caa8e9d3abe9a6"
    ["Upload"] => string(12) "Submit Query"
  }
}
 

Adam Howard

Well-known member
#3
Further looking at the error.....

failed to open stream: Permission denied

Make sure you're using your user account to change folder permissions or when ftp`ing things to your site and not root.
 

Adam Howard

Well-known member
#5
http://xenforo.com/community/threads/cant-upload-images.64448/#post-680034

Make sure the owner of those folders are the web user and not root.... ie... Just because you can log into root, doesn't mean you should.

I've seen that error before and it usually means someone uploaded an add-on or folders using root log on. The problem is for your own protection and security, those folders can't be accessed publicly if the root user owns them.

So you should only be uploading things via FTP using a normal user account (not root).

Does that make sense to you?
 

wickedstangs

Well-known member
#6
http://xenforo.com/community/threads/cant-upload-images.64448/#post-680034

Make sure the owner of those folders are the web user and not root.... ie... Just because you can log into root, doesn't mean you should.

I've seen that error before and it usually means someone uploaded an add-on or folders using root log on. The problem is for your own protection and security, those folders can't be accessed publicly if the root user owns them.

So you should only be uploading things via FTP using a normal user account (not root).

Does that make sense to you?
Yes, it does, and I have not used root to upload thing...
 

Adam Howard

Well-known member
#8
admin.php?tools/phpinfo

Can you confirm the value of upload_tmp_dir in your phpinfo? Make sure that directory exists and is writable. If it is "no value" then it should default to /tmp on the server in which case you need to make sure that directory exists and is writable. Also make sure the partition is not full. You can check the partitions by running this shell command:
Code:
df