[bd] Attachment Store for XenForo 1 [Paid] 1.3.7

Store attachment differently and more effectively.

  1. simon

    simon New Member

    Are you using the same software as the Brogan Bot? :)

    I have posted twice one at 3am and the other at 9.40am and you replied to both within 10 Mins!

    Thank you very much, very nice and useful addon.

    Thanks
     
    xfrocks likes this.
  2. David B. Bitton

    David B. Bitton New Member

    Hi,
    I enabled the addon, and when I attempt to rebuild the cache, I receive the following error

    Code:
    Host "soulsimagined_com_forums_cdn.s3.amazonaws.com" is not a valid HTTP host
    It resolves and load fine, albeit with a 403, but that is expected. Thanks!
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @David B. Bitton I'm assuming that you are trying to move the attachments from default storage to S3 storage? The error happened at the very beginning of the process or it happened in the middle of it?
       
    2. David B. Bitton

      David B. Bitton New Member

      David B. Bitton @xfrocks
      It happened right after I clicked Rebuild Now. I did some looking into the Zend code and that should pass validation.

      PHP:
      Admin Control Panel SoulsImagined.
      Server Error
       
      Host 
      "soulsimagined_com_forums_cdn.s3.amazonaws.com" is not a valid HTTP host
       
      Zend_Uri_Http
      ->setHost() in Zend/Service/Amazon/S3.php at line 590
      Zend_Service_Amazon_S3
      ->_makeRequest() in Zend/Service/Amazon/S3.php at line 412
      Zend_Service_Amazon_S3
      ->putObject() in Zend/Service/Amazon/S3.php at line 454
      Zend_Service_Amazon_S3
      ->putFile() in bdAttachmentStore/Model/File.php at line 147
      bdAttachmentStore_Model_File
      ->_s3_saveFile() in bdAttachmentStore/Model/File.php at line 14
      bdAttachmentStore_Model_File
      ->saveFile() in bdAttachmentStore/XenForo/DataWriter/AttachmentData.php at line 118
      bdAttachmentStore_XenForo_DataWriter_AttachmentData
      ->_writeAttachmentFile() in XenForo/DataWriter/AttachmentData.php at line 117
      XenForo_DataWriter_AttachmentData
      ->_postSave() in XenForo/DataWriter.php at line 1385
      XenForo_DataWriter
      ->save() in bdAttachmentStore/CacheRebuilder/AttachmentData.php at line 98
      bdAttachmentStore_CacheRebuilder_AttachmentData
      ->rebuild() in XenForo/ControllerHelper/CacheRebuild.php at line 26
      XenForo_ControllerHelper_CacheRebuild
      ->rebuildCache() in XenForo/ControllerAdmin/Tools.php at line 78
      XenForo_ControllerAdmin_Tools
      ->actionCacheRebuild() in XenForo/FrontController.php at line 313
      XenForo_FrontController
      ->dispatch() in XenForo/FrontController.php at line 132
      XenForo_FrontController
      ->run() in /var/www/soulsimagined.com/forums/admin.php at line 13
       
    3. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @David B. Bitton Can you please post screenshot of the option page? Please remember to hide sensitive information from the screenshot. Or you can start a conversation with me and send the file more privately.
       
  3. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    MattW likes this.
  4. andret

    andret New Member

    I have been trying this with both cloudflare and cloudfront, as well as directly trough s3, but nomatter what I do, only tumbnails gets shared trough s3, the full images are linked directly to the local store. Am I doing something wrong?
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @andret Please note that for CloudFront integration, the attachment link will be kept as it is (/attachments/file.number/) but after the permission check, user will be redirected to CloudFront server to actually download the file. This is done to make sure the attachment permission is validated properly.

      For direct S3 mode (through CloudFlare or not), the S3 url should replace the original attachment link in posts. If your thumbnail links work, that means the add-on runs correctly when the file is uploaded but something prevented it from changing the attachment link.

      Can you try again with that information in mind. If you still have problem, feel free to start a conversation with me with your site address. I will come by and troubleshot the problem further.
       
  5. MattW

    MattW Member

    Upgraded to XF 1.2 Gold just now, and this add-on is now erroring:

    Code:
    ErrorException: Declaration of bdAttachmentStore_XenForo_Model_Attachment::getAttachmentDataFilePath() should be compatible with XenForo_Model_Attachment::getAttachmentDataFilePath(array $data, $internalDataPath = NULL) - library/bdAttachmentStore/XenForo/Model/Attachment.php:8
    Generated By: Unknown Account, A moment ago
    Stack Trace
    #0 /home/z22se/public_html/library/bdAttachmentStore/XenForo/Model/Attachment.php(8): XenForo_Application::handlePhpError(2048, 'Declaration of ...', '/home/z22se/pub...', 8, Array)
    #1 /home/z22se/public_html/library/XenForo/Autoloader.php(119): include('/home/z22se/pub...')
    #2 /home/z22se/public_html/library/XenForo/Application.php(959): XenForo_Autoloader->autoload('bdAttachmentSto...')
    #3 /home/z22se/public_html/library/XenForo/Application.php(483): XenForo_Application::autoload('bdAttachmentSto...')
    #4 /home/z22se/public_html/library/XenForo/Model.php(189): XenForo_Application::resolveDynamicClass('XenForo_Model_A...', 'model')
    #5 /home/z22se/public_html/library/XenForo/Controller.php(101): XenForo_Model::create('XenForo_Model_A...')
    #6 /home/z22se/public_html/library/XenForo/ControllerPublic/Thread.php(1805): XenForo_Controller->getModelFromCache('XenForo_Model_A...')
    #7 /home/z22se/public_html/library/XenForo/ControllerPublic/Thread.php(174): XenForo_ControllerPublic_Thread->_getAttachmentModel()
    #8 /home/z22se/public_html/library/ThreadWatchers/ControllerPublic/Thread.php(7): XenForo_ControllerPublic_Thread->actionIndex()
    #9 /home/z22se/public_html/library/XenForo/FrontController.php(337): ThreadWatchers_ControllerPublic_Thread->actionIndex()
    #10 /home/z22se/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #11 /home/z22se/public_html/index.php(13): XenForo_FrontController->run()
    #12 {main}
    Request State
    array(3) {
      ["url"] => string(49) "http://www.z22se.co.uk/threads/irmscher-hq.14029/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
    }
     
  6. MattW

    MattW Member

    I think I've been able to fix this by changing Attachment.php

    Code:
    z22se@z22se.co.uk [~/public_html/library/bdAttachmentStore/XenForo/Model]# diff Attachment.php Attachment.php.old
    21c21
    <      public function getAttachmentDataFilePath(array $data, $internalDataPath = NULL)
    ---
    >      public function getAttachmentDataFilePath(array $data)
    41c41
    <      public function getAttachmentThumbnailFilePath(array $data, $internalDataPath = NULL)
    ---
    >      public function getAttachmentThumbnailFilePath(array $data)
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @MattW That will work but I recommend upgrading to v0.9.11 for complete 1.2 support.
       
      MattW likes this.
      1
    2. MattW

      MattW Member

      MattW @xfrocks Upgrading now :)
       
  7. xfrocks

    xfrocks XenForo rocks!
    Staff Member

  8. MattW

    MattW Member

    Hi xfrocks - since the update to 0.9.11 it's not creating thumbnails for bob's showcase or chris' xenmediagallery.

    If I disable this add-on, thumbnails are generated for new images that are uploaded.
     
  9. Scharesoft

    Scharesoft New Member

    Is it possible to keep the names of the files? Your Addon change the names for example from "Real_Shelter_-_Regenabweisende_Daecher-0.98c.zip" to "18_8faf23c0fa2ee331b31b5b1785565f2f.zip" (I use "Store file in remote server (via FTP)"). The filename with an id would be great.

    Also the attachments for Xen Media Galery doesn't work. The Picture itself I can find on the server, but the attachment is still there: "/data/xengallery/0/19-2a0aa6be4b4c479ecb12f97dbefd7cff.jpg".
     
  10. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    You guys don't have to repost twice at xenforo.com and here ;) Pick the one which is more convenient for you.
     
    MattW and Scharesoft like this.
  11. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    XFNewbie likes this.
  12. XFNewbie

    XFNewbie New Member

    You can guide for me to configure FTP ..You can write thread or video ..
     
  13. xfrocks

    xfrocks XenForo rocks!
    Staff Member

  14. GuiltWolf

    GuiltWolf New Member

    i'dont what happen but i got some error when enable plugin
    Code:
    Server Error Log
    Error Info
    ErrorException: Fatal Error: Cannot redeclare class bdAttachmentStore_XenForo_Model_Attachment - library/bdAttachmentStore/XenForo/Model/Attachment.php:97
    Generated By: GuiltWolf, 3 minutes ago
    Stack Trace
    #0 [internal function]: XenForo_Application::handleFatalError('bdAttachmentSto...')
    #1 {main}
    Request State
    array(3) {
      ["url"] => string(48) "http://forum.wolf.in.th/forums/gen/create-thread"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
    }
    Code:
    Strict Standards: Declaration of bdAttachmentStore_XenForo_Model_Attachment::getAttachmentDataFilePath() should be compatible with that of XenForo_Model_Attachment::getAttachmentDataFilePath() in /home/guiltwol/domains/forum.wolf.in.th/public_html/library/bdAttachmentStore/XenForo/Model/Attachment.php on line 0
    
    Strict Standards: Declaration of bdAttachmentStore_XenForo_Model_Attachment::getAttachmentThumbnailFilePath() should be compatible with that of XenForo_Model_Attachment::getAttachmentThumbnailFilePath() in /home/guiltwol/domains/forum.wolf.in.th/public_html/library/bdAttachmentStore/XenForo/Model/Attachment.php on line 0
    
    Fatal error: Cannot redeclare class bdAttachmentStore_XenForo_Model_Attachment in /home/guiltwol/domains/forum.wolf.in.th/public_html/library/bdAttachmentStore/XenForo/Model/Attachment.php on line 97
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @GuiltWolf What is your version of XenForo and this add-on? Also, PHP version please?
       
    2. GuiltWolf

      GuiltWolf New Member

  15. GuiltWolf

    GuiltWolf New Member

    and plug-in it's 0.9.12
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @GuiltWolf Can you try downloading the add-on again then upload the files overwriting again to see if it works. The error indicates that your files are not up to date.
       
  16. GuiltWolf

    GuiltWolf New Member

    Done, but error still appear.

    i don't know because some of another plugin make this or not

    [​IMG]
    [​IMG]
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

  17. sonnb

    sonnb New Member

    Do you think that we should save "Keep Local Copy" option into the attachment's options? Because we do not know which attachment has local copy since this option was turned on/off.
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @sonnb Sorry @sonnb, I don't understand your question? You meant the option page in AdminCP or a options field in the attachment table?
       
  18. sonnb

    sonnb New Member

    In the field bdattachmentstore_options in attachment table.
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @sonnb Ah, I see your point. Keep-local information is not kept in options field because it is not needed to calculate the URL or delete the file later. If you need to check for local copy, just get the attachment data path and be done with it?
       
    2. sonnb

      sonnb New Member

      sonnb @xfrocks Of course we do not need it for attachment. Just a suggestion in case we need to process something with the attachments so we need to do both on "cloud" and local. Keep that option in the table is an indicator that a specific attachment has a copy in local.

      Thanks for your answer.
       
      xfrocks likes this.
      1
  19. xfrocks

    xfrocks XenForo rocks!
    Staff Member

  20. cees50

    cees50 New Member

    Just a question if i understand this right.

    This add on will store all the attachments on a server thats not mine, but on the S3. If i use this add on, the add on will transfer all my attachment to that server, and wont store it on my server? And what does the keep local information does? Puts the attachments again on my server and in S3? My forum runs for almost a year now, and i allready have a 16 Gb attachments.. So i need some solution to cut prices :)
     
Loading...