Error if i try to upload images XenForo and Media Gallery

Tealk

Well-known member
Hi,

if i try to upload a image file i get the message
THE FOLLOWING ERROR OCCURRED
There was a problem uploading your file.

asdf.png
I have try it with some images but all give me this error message

Code:
Error Info
copy(/home/www/anzahcraft.de/internal_data/attachments/0/325-b27f4fcc91a7cf9317ea20bd7c068153.data): failed to open stream: Permission denied - library/XenForo/Helper/File.php:261

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'copy(/home/www/...', '/home/www/anzah...', 261, Array)
#1 /home/www/anzahcraft.de/library/XenForo/Helper/File.php(261): copy('/tmp/phpV2Tw8s', '/home/www/anzah...')
#2 /home/www/anzahcraft.de/library/XenForo/DataWriter/AttachmentData.php(265): XenForo_Helper_File::safeRename('/tmp/phpV2Tw8s', '/home/www/anzah...')
#3 /home/www/anzahcraft.de/library/XenForo/DataWriter/AttachmentData.php(224): XenForo_DataWriter_AttachmentData->_moveFile('/tmp/phpV2Tw8s', '/home/www/anzah...')
#4 /home/www/anzahcraft.de/library/XenGallery/DataWriter/AttachmentData.php(53): XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/phpV2Tw8s', Array, false)
#5 /home/www/anzahcraft.de/library/XenForo/DataWriter/AttachmentData.php(144): XenGallery_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/phpV2Tw8s', Array)
#6 /home/www/anzahcraft.de/library/XenForo/DataWriter.php(1423): XenForo_DataWriter_AttachmentData->_postSave()
#7 /home/www/anzahcraft.de/library/XenForo/Model/Attachment.php(539): XenForo_DataWriter->save()
#8 /home/www/anzahcraft.de/library/XenForo/ControllerPublic/Attachment.php(205): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 1)
#9 /home/www/anzahcraft.de/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Attachment->actionDoUpload()
#10 /home/www/anzahcraft.de/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#11 /home/www/anzahcraft.de/index.php(13): XenForo_FrontController->run()
#12 {main}

Request State
Array
(
    [url] => https://anzahcraft.de/attachments/do-upload.json?hash=b1a6858f0ea6f47cfcda52d44bc46988&content_type=post
    [_GET] => Array
        (
            [hash] => b1a6858f0ea6f47cfcda52d44bc46988
            [content_type] => post
        )

    [_POST] => Array
        (
            [_xfToken] => ********
            [_xfNoRedirect] => 1
            [_xfResponseType] => json
            [_xfSessionId] => 7d7a599940f94c5f8bbbd21039c38adc
            [content_data] => Array
                (
                    [thread_id] => 1671
                )

            [flowChunkNumber] => 1
            [flowChunkSize] => 4294967296
            [flowCurrentChunkSize] => 19072
            [flowTotalSize] => 19072
            [flowIdentifier] => 19072-asdfpng
            [flowFilename] => asdf.png
            [flowRelativePath] => asdf.png
            [flowTotalChunks] => 1
        )

)

Code:
Error Info
tempnam(): file created in the system's temporary directory - library/XenForo/Model/Attachment.php:499

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(8, 'tempnam(): file...', '/home/www/anzah...', 499, Array)
#1 /home/www/anzahcraft.de/library/XenForo/Model/Attachment.php(499): tempnam('/home/www/anzah...', 'xf')
#2 /home/www/anzahcraft.de/library/XenForo/ControllerPublic/Attachment.php(205): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 1)
#3 /home/www/anzahcraft.de/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Attachment->actionDoUpload()
#4 /home/www/anzahcraft.de/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/www/anzahcraft.de/index.php(13): XenForo_FrontController->run()
#6 {main}

Request State
Array
(
    [url] => https://anzahcraft.de/attachments/do-upload.json?hash=b1a6858f0ea6f47cfcda52d44bc46988&content_type=post
    [_GET] => Array
        (
            [hash] => b1a6858f0ea6f47cfcda52d44bc46988
            [content_type] => post
        )

    [_POST] => Array
        (
            [_xfToken] => ********
            [_xfNoRedirect] => 1
            [_xfResponseType] => json
            [_xfSessionId] => 7d7a599940f94c5f8bbbd21039c38adc
            [content_data] => Array
                (
                    [thread_id] => 1671
                )

            [flowChunkNumber] => 1
            [flowChunkSize] => 4294967296
            [flowCurrentChunkSize] => 19072
            [flowTotalSize] => 19072
            [flowIdentifier] => 19072-asdfpng
            [flowFilename] => asdf.png
            [flowRelativePath] => asdf.png
            [flowTotalChunks] => 1
        )

)
 
Upload on Media Gallery errors
Code:
Error Info
copy(/home/www/anzahcraft.de/internal_data/attachments/0/327-b27f4fcc91a7cf9317ea20bd7c068153.data): failed to open stream: Permission denied - library/XenGallery/DataWriter/AttachmentData.php:66

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'copy(/home/www/...', '/home/www/anzah...', 66, Array)
#1 /home/www/anzahcraft.de/library/XenGallery/DataWriter/AttachmentData.php(66): copy('/tmp/phpMaBCss', '/home/www/anzah...')
#2 /home/www/anzahcraft.de/library/XenGallery/DataWriter/AttachmentData.php(41): XenGallery_DataWriter_AttachmentData->_copyFile('/tmp/phpMaBCss', '/home/www/anzah...')
#3 /home/www/anzahcraft.de/library/XenForo/DataWriter/AttachmentData.php(144): XenGallery_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/phpMaBCss', Array)
#4 /home/www/anzahcraft.de/library/XenForo/DataWriter.php(1423): XenForo_DataWriter_AttachmentData->_postSave()
#5 /home/www/anzahcraft.de/library/XenGallery/Model/File.php(125): XenForo_DataWriter->save()
#6 /home/www/anzahcraft.de/library/XenGallery/ControllerPublic/File.php(201): XenGallery_Model_File->insertUploadedAttachmentData(Object(XenForo_Upload), 1, Array)
#7 /home/www/anzahcraft.de/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_File->actionDoUpload()
#8 /home/www/anzahcraft.de/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/www/anzahcraft.de/index.php(13): XenForo_FrontController->run()
#10 {main}

Request State
Array
(
    [url] => https://anzahcraft.de/media/files/do-upload.json?hash=1adb8879b5e5cfc1e3bf598559dc04d7&content_type=xengallery_media&upload_type=image_upload&key=image_upload
    [_GET] => Array
        (
            [hash] => 1adb8879b5e5cfc1e3bf598559dc04d7
            [content_type] => xengallery_media
            [upload_type] => image_upload
            [key] => image_upload
        )

    [_POST] => Array
        (
            [_xfToken] => ********
            [_xfNoRedirect] => 1
            [_xfResponseType] => json
            [_xfSessionId] => 7d7a599940f94c5f8bbbd21039c38adc
            [content_data] => Array
                (
                    [category_id] => 1
                )

            [flowChunkNumber] => 1
            [flowChunkSize] => 4294967296
            [flowCurrentChunkSize] => 19072
            [flowTotalSize] => 19072
            [flowIdentifier] => 19072-asdfpng
            [flowFilename] => asdf.png
            [flowRelativePath] => asdf.png
            [flowTotalChunks] => 1
        )

)

Code:
Error Info
tempnam(): file created in the system's temporary directory - library/XenGallery/Helper/Image.php:108

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(8, 'tempnam(): file...', '/home/www/anzah...', 108, Array)
#1 /home/www/anzahcraft.de/library/XenGallery/Helper/Image.php(108): tempnam('/home/www/anzah...', 'xfmg')
#2 /home/www/anzahcraft.de/library/XenGallery/Helper/Image.php(44): XenGallery_Helper_Image->setPathToTempFiles('/home/www/anzah...')
#3 /home/www/anzahcraft.de/library/XenGallery/Model/File.php(84): XenGallery_Helper_Image->__construct('/tmp/xfmgQmc7YG')
#4 /home/www/anzahcraft.de/library/XenGallery/ControllerPublic/File.php(201): XenGallery_Model_File->insertUploadedAttachmentData(Object(XenForo_Upload), 1, Array)
#5 /home/www/anzahcraft.de/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_File->actionDoUpload()
#6 /home/www/anzahcraft.de/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /home/www/anzahcraft.de/index.php(13): XenForo_FrontController->run()
#8 {main}

Request State
Array
(
    [url] => https://anzahcraft.de/media/files/do-upload.json?hash=1adb8879b5e5cfc1e3bf598559dc04d7&content_type=xengallery_media&upload_type=image_upload&key=image_upload
    [_GET] => Array
        (
            [hash] => 1adb8879b5e5cfc1e3bf598559dc04d7
            [content_type] => xengallery_media
            [upload_type] => image_upload
            [key] => image_upload
        )

    [_POST] => Array
        (
            [_xfToken] => ********
            [_xfNoRedirect] => 1
            [_xfResponseType] => json
            [_xfSessionId] => 7d7a599940f94c5f8bbbd21039c38adc
            [content_data] => Array
                (
                    [category_id] => 1
                )

            [flowChunkNumber] => 1
            [flowChunkSize] => 4294967296
            [flowCurrentChunkSize] => 19072
            [flowTotalSize] => 19072
            [flowIdentifier] => 19072-asdfpng
            [flowFilename] => asdf.png
            [flowRelativePath] => asdf.png
            [flowTotalChunks] => 1
        )

)

Code:
Error Info
tempnam(): file created in the system's temporary directory - library/XenGallery/Model/File.php:42

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(8, 'tempnam(): file...', '/home/www/anzah...', 42, Array)
#1 /home/www/anzahcraft.de/library/XenGallery/Model/File.php(42): tempnam('/home/www/anzah...', 'xfmg')
#2 /home/www/anzahcraft.de/library/XenGallery/ControllerPublic/File.php(201): XenGallery_Model_File->insertUploadedAttachmentData(Object(XenForo_Upload), 1, Array)
#3 /home/www/anzahcraft.de/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_File->actionDoUpload()
#4 /home/www/anzahcraft.de/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#5 /home/www/anzahcraft.de/index.php(13): XenForo_FrontController->run()
#6 {main}

Request State
Array
(
    [url] => https://anzahcraft.de/media/files/do-upload.json?hash=1adb8879b5e5cfc1e3bf598559dc04d7&content_type=xengallery_media&upload_type=image_upload&key=image_upload
    [_GET] => Array
        (
            [hash] => 1adb8879b5e5cfc1e3bf598559dc04d7
            [content_type] => xengallery_media
            [upload_type] => image_upload
            [key] => image_upload
        )

    [_POST] => Array
        (
            [_xfToken] => ********
            [_xfNoRedirect] => 1
            [_xfResponseType] => json
            [_xfSessionId] => 7d7a599940f94c5f8bbbd21039c38adc
            [content_data] => Array
                (
                    [category_id] => 1
                )

            [flowChunkNumber] => 1
            [flowChunkSize] => 4294967296
            [flowCurrentChunkSize] => 19072
            [flowTotalSize] => 19072
            [flowIdentifier] => 19072-asdfpng
            [flowFilename] => asdf.png
            [flowRelativePath] => asdf.png
            [flowTotalChunks] => 1
        )

)
 
Looks like file system permissions.

Make sure the internal_data and data directories and all of the folders and files inside are writable by the web server user.
 
Back
Top Bottom