1. 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

Discussion in 'Resolved Bug Reports' started by Blandt, Oct 23, 2010.

  1. Blandt

    Blandt 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 ?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Full size images are stored in internal_data\attachments\ and referenced by the xf_attachment_data table.
    Blandt likes this.
  3. Blandt

    Blandt Well-Known Member

    Can the hash function be the cause ?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    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.
    Blandt likes this.
  5. Blandt

    Blandt 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 ?
  6. Brogan

    Brogan 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.

  7. Blandt

    Blandt Well-Known Member

    The screen shot above shows the thumbnail folder data/attachment ...

    Here is the screen shot of the internal_data/attachment

  8. Blandt

    Blandt 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 ?
  9. Brogan

    Brogan XenForo Moderator Staff Member

    That all looks OK then as far as I can tell.

    Oh well, back to the drawing board :D
  10. Blandt

    Blandt 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
  11. Edrondol

    Edrondol 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.
  12. Blandt

    Blandt Well-Known 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
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Looking at his cPanel:
    MySQL version 5.0.91-community
    PHP version 5.2.14
  14. z3r010

    z3r010 Member

    I'm getting the same issue with:-

    Windows Server 2008R2
    IIS7.5 fastcgi
    PHP 5.3.3
    MySQL 5.1.45-community
  15. Edrondol

    Edrondol 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.
  16. Blandt

    Blandt 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
    Brogan likes this.
  17. Brogan

    Brogan XenForo Moderator Staff Member

    What's the bet as soon as Mike sees this he'll have it fixed in less time than it took to post that :D
  18. Blandt

    Blandt Well-Known Member

    I hope so :)
  19. Paul M

    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.
  20. Edrondol

    Edrondol Well-Known Member

    Did the edit and tried it again. Same thing.

Share This Page