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

Fixed  Clarification on how Xenforo handles attachment


Well-known member
Under IIS, Attachments are not being displayed correctly. (broken images as reported in other threads)

the Data folder contains the thumbnails and the thumbnails are displayed correctly.

the Internal_Data folder contains .data files corresponding to each thumbnail in the Data folder.

My question is how do we store full size images ?


XenForo moderator
Staff member
Can the hash function be the cause ?
I wonder if we can get the record from Dave's xf_attachment_data table and the corresponding file name in the internal_data\attachments\ folder?
That might help with working out what the problem is.

Edit: Just checking now.


Well-known member
Here is one record :


And here is the attachment folder

As you can see there is that prefix of 1 (2 , 3 , 4 respectively)

Could that be the problem ?


XenForo moderator
Staff member
This is my table hash: 0d16d0469ba1269d061dab1f90aacaa5
And this is the file name: 1-0d16d0469ba1269d061dab1f90aacaa5

But those file sizes you've posted don't match with the table contents.
Are you looking in the correct folder as the file size should be 750KB looking at the table.



Well-known member
The screen shot above shows the thumbnail folder data/attachment ...

Here is the screen shot of the internal_data/attachment



Well-known member
I'm trying to eliminate possible causes.

Permission is checked and everything is fine.
The only thing left is the hash function not working as intended on windows ? hmmm ... any ideas ?


Well-known member
Yes ... the IIS trace is giving 403 forbidden error
which usually is about permission :confused: ... blah .. I'll give it some rest ... be back in few


Well-known member
You guys do rule. And I thank you for helping me out. I know it's helping you, too, but I'm still very thankful.
Would you ask your host for your server version : Os distro / PHP and Mysql ? I'd like to compare configurations .. maybe that would help narrow down the problem


XenForo moderator
Staff member
Would you ask your host for your server version : Os distro / PHP and Mysql ? I'd like to compare configurations .. maybe that would help narrow down the problem
Looking at his cPanel:
MySQL version 5.0.91-community
PHP version 5.2.14


Well-known member
PHP - 5.2.14
MySQL - 5.0.91-community

OS Distro...um...I have a vague idea of what that is and I'm sure I have access to it. Host might take a bit to get the information from.


Well-known member
Ok I have good news and bad news :D

The good news :
the log shows some errors :

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: DELAYED option not supported for table 'xf_attachment_view' - library\Zend\Db\Statement\Mysqli.php:77
Generated By: Ben, 27 minutes ago

Stack trace :

#0 C:\inetpub\wwwroot\xenfoo.com\library\Zend\Db\Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('?????INSERT DEL...') #1 C:\inetpub\wwwroot\xenfoo.com\library\Zend\Db\Adapter\Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '?????INSERT DEL...') #2 C:\inetpub\wwwroot\xenfoo.com\library\Zend\Db\Adapter\Abstract.php(467): Zend_Db_Adapter_Mysqli->prepare('?????INSERT DEL...') #3 C:\inetpub\wwwroot\xenfoo.com\library\XenForo\Model\Attachment.php(480): Zend_Db_Adapter_Abstract->query('?????INSERT DEL...', 4) #4 C:\inetpub\wwwroot\xenfoo.com\library\XenForo\ControllerPublic\Attachment.php(48): XenForo_Model_Attachment->logAttachmentView(4) #5 C:\inetpub\wwwroot\xenfoo.com\library\XenForo\FrontController.php(303): XenForo_ControllerPublic_Attachment->actionIndex() #6 C:\inetpub\wwwroot\xenfoo.com\library\XenForo\FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch)) #7 C:\inetpub\wwwroot\xenfoo.com\index.php(15): XenForo_FrontController->run() #8 {main}

Request state
array(3) { ["url"] => string(50) "http://www.xenfoo.com/attachments/jellyfish-jpg.4/" ["_GET"] => array(0) { } ["_POST"] => array(0) { } }

The bad news is I have no idea what's going on :D

Paul M

Well-known member
Its a simple error - the function logAttachmentView() is using a Delayed Insert - but the dastabase table is a Memory table which doesnt support them.

If you fancy a go at fixing it yourself, find the function in \library\XenForo\Model\Attachment.php

(line 470)

public function logAttachmentView($attachmentId)
INSERT DELAYED INTO xf_attachment_view
', $attachmentId);

Remove the word DELAYED and you should be good to go.