[bd] Attachment Store [Deleted]

I can be made to work similar to S3 with CloudFront integration, the attachment link will be kept as /attachments/id and whenever a user requests the file, permission will be checked before redirecting to the real URL to download the file.

This would be a good improvement, it's definitely better than showing directly the path to the files.

About your second suggestion, maybe it's a better idea to provide members with a "storage" so they can upload files as they want to. In your case: upload the resource, get the direct link and paste it into "external download" field?

Such storage for users wouldn't be good for my needs. With these direct links they could publish the links everywhere and would not use the resource manager. On my page there is a download area with more than 2500 files, each of them on an the additional download server. They need to see the advertisment there, the traffic would otherwise be unaffordable.

Hiding the direct links is really important, so that they need to use the resource manager to download files. The best would be an additional opportunity of uploading files to the resource manager with their own ftp settings (like "Allowed Resource Types" for a resource manager category), so that they not use the same path as normal attachments.

Since this does not seems to be possible, a method like the one I described before would be at least a possibility. For a better idea and a good implementation I would definitly pay something. But I think this would be an other addon, so I started this request.
 
Last edited:
You guys know what? v0.9.7 now has support for CloudFront ;)
I'm a little confused. I will be using this for resource manager and in-conjunction with a credits system to charge users to download resources. Once they "purchase" the resource, the download link becomes available. Can they share this download link with everyone or is it unique to their account? I can't afford to have the links shared among users so I'm wondering how Amazon/Xenforo check for permission?
 
I'm a little confused. I will be using this for resource manager and in-conjunction with a credits system to charge users to download resources. Once they "purchase" the resource, the download link becomes available. Can they share this download link with everyone or is it unique to their account? I can't afford to have the links shared among users so I'm wondering how Amazon/Xenforo check for permission?
If you need protection for link, you will need to setup S3+CloudFront. For step by step instruction, see here

https://xfrocks.com/other/threads/howto-xenforo-attachments-via-amazon-s3-and-cloudfront.60/
 
I got this error 22 minutes ago.

Also posted it here: http://xenforo.com/community/threads/metamirror.55736/page-11#post-629918

ErrorException: rename(/home/blah/public_html/data/MetaMirrorCache/awww.elianthony.com_v1_images_stories_albums_album20_IMG_7854.jpg,/home/blah/public_html/data/attachment-files/2010/11/11695_awww.elianthony.com_v1_images_stories_albums_album20_IMG_7854.jpg): No such file or directory - library/bdAttachmentStore/Model/File.php:305 Generated By: Unknown Account, 21 minutes ago Stack Trace #0 [internal function]: XenForo_Application::handlePhpError(2, 'rename(/home/dr...', '/home/blah/publi...', 305, Array) #1 /home/blah/public_html/library/bdAttachmentStore/Model/File.php(305): rename('/home/blah/publi...', '/home/blah/publi...') #2 /home/blah/public_html/library/bdAttachmentStore/Model/File.php(259): bdAttachmentStore_Model_File->_externalData_moveFile('/home/blah/publi...', '/home/blah/publi...') #3 /home/blah/public_html/library/bdAttachmentStore/Model/File.php(18): bdAttachmentStore_Model_File->_externalData_saveFile(Array, '/home/blah/publi...', '2010/11/11695_1...', 'awww.elianthony...') #4 /home/blah/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(118): bdAttachmentStore_Model_File->saveFile('external_data', Array, '/home/blah/publi...', '2010/11/11695_1...', 'awww.elianthony...') #5 /home/blah/public_html/library/XenForo/DataWriter/AttachmentData.php(143): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/home/blah/publi...', Array) #6 /home/blah/public_html/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_AttachmentData->_postSave() #7 /home/blah/public_html/library/XenForo/Model/Attachment.php(524): XenForo_DataWriter->save() #8 /home/blah/public_html/library/MetaMirror/CronEntry.php(411): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 180, Array) #9 /home/blah/public_html/library/MetaMirror/CronEntry.php(885): MetaMirror_CronEntry::importPostAttachment(Object(Zend_Db_Adapter_Mysqli), 'awww.elianthony...', '/home/blah/publi...', 180, 16142, 1291083443) #10 /home/blah/public_html/library/MetaMirror/CronEntry.php(1052): MetaMirror_CronEntry::updateSingleContent(Array) #11 /home/blah/public_html/library/MetaMirror/CronEntry.php(544): MetaMirror_CronEntry::runForContentType() #12 [internal function]: MetaMirror_CronEntry::runMetaMirror(Array) #13 /home/blah/public_html/library/XenForo/Model/Cron.php(356): call_user_func(Array, Array) #14 /home/blah/public_html/library/WhoHasReadAThread/Model/Cron.php(30): XenForo_Model_Cron->runEntry(Array) #15 /home/blah/public_html/library/XenForo/Deferred/Cron.php(22): WhoHasReadAThread_Model_Cron->runEntry(Array) #16 /home/blah/public_html/library/XenForo/Model/Deferred.php(198): XenForo_Deferred_Cron->execute(Array, Array, 9.99999594688, '') #17 /home/blah/public_html/library/XenForo/Model/Deferred.php(321): XenForo_Model_Deferred->runDeferred(Array, 9.99999594688, '', false) #18 /home/blah/public_html/library/XenForo/Model/Deferred.php(274): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false) #19 /home/blah/public_html/deferred.php(18): XenForo_Model_Deferred->run(false) #20 {main} Request State array(3) { ["url"] => string(29) "http://8thos.com/deferred.php" ["_GET"] => array(0) { } ["_POST"] => array(4) { ["_xfRequestUri"] => string(34) "/admin.php?options/list/MetaMirror" ["_xfNoRedirect"] => string(1) "1" ["_xfToken"] => string(8) "********" ["_xfResponseType"] => string(4) "json" } }
 
I got this error 22 minutes ago.

Also posted it here: http://xenforo.com/community/threads/metamirror.55736/page-11#post-629918

ErrorException: rename(/home/blah/public_html/data/MetaMirrorCache/awww.elianthony.com_v1_images_stories_albums_album20_IMG_7854.jpg,/home/blah/public_html/data/attachment-files/2010/11/11695_awww.elianthony.com_v1_images_stories_albums_album20_IMG_7854.jpg): No such file or directory - library/bdAttachmentStore/Model/File.php:305 Generated By: Unknown Account, 21 minutes ago Stack Trace #0 [internal function]: XenForo_Application::handlePhpError(2, 'rename(/home/dr...', '/home/blah/publi...', 305, Array) #1 /home/blah/public_html/library/bdAttachmentStore/Model/File.php(305): rename('/home/blah/publi...', '/home/blah/publi...') #2 /home/blah/public_html/library/bdAttachmentStore/Model/File.php(259): bdAttachmentStore_Model_File->_externalData_moveFile('/home/blah/publi...', '/home/blah/publi...') #3 /home/blah/public_html/library/bdAttachmentStore/Model/File.php(18): bdAttachmentStore_Model_File->_externalData_saveFile(Array, '/home/blah/publi...', '2010/11/11695_1...', 'awww.elianthony...') #4 /home/blah/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(118): bdAttachmentStore_Model_File->saveFile('external_data', Array, '/home/blah/publi...', '2010/11/11695_1...', 'awww.elianthony...') #5 /home/blah/public_html/library/XenForo/DataWriter/AttachmentData.php(143): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/home/blah/publi...', Array) #6 /home/blah/public_html/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_AttachmentData->_postSave() #7 /home/blah/public_html/library/XenForo/Model/Attachment.php(524): XenForo_DataWriter->save() #8 /home/blah/public_html/library/MetaMirror/CronEntry.php(411): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 180, Array) #9 /home/blah/public_html/library/MetaMirror/CronEntry.php(885): MetaMirror_CronEntry::importPostAttachment(Object(Zend_Db_Adapter_Mysqli), 'awww.elianthony...', '/home/blah/publi...', 180, 16142, 1291083443) #10 /home/blah/public_html/library/MetaMirror/CronEntry.php(1052): MetaMirror_CronEntry::updateSingleContent(Array) #11 /home/blah/public_html/library/MetaMirror/CronEntry.php(544): MetaMirror_CronEntry::runForContentType() #12 [internal function]: MetaMirror_CronEntry::runMetaMirror(Array) #13 /home/blah/public_html/library/XenForo/Model/Cron.php(356): call_user_func(Array, Array) #14 /home/blah/public_html/library/WhoHasReadAThread/Model/Cron.php(30): XenForo_Model_Cron->runEntry(Array) #15 /home/blah/public_html/library/XenForo/Deferred/Cron.php(22): WhoHasReadAThread_Model_Cron->runEntry(Array) #16 /home/blah/public_html/library/XenForo/Model/Deferred.php(198): XenForo_Deferred_Cron->execute(Array, Array, 9.99999594688, '') #17 /home/blah/public_html/library/XenForo/Model/Deferred.php(321): XenForo_Model_Deferred->runDeferred(Array, 9.99999594688, '', false) #18 /home/blah/public_html/library/XenForo/Model/Deferred.php(274): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false) #19 /home/blah/public_html/deferred.php(18): XenForo_Model_Deferred->run(false) #20 {main} Request State array(3) { ["url"] => string(29) "http://8thos.com/deferred.php" ["_GET"] => array(0) { } ["_POST"] => array(4) { ["_xfRequestUri"] => string(34) "/admin.php?options/list/MetaMirror" ["_xfNoRedirect"] => string(1) "1" ["_xfToken"] => string(8) "********" ["_xfResponseType"] => string(4) "json" } }
[bd] attachment store addon is nothing to do with MetaMirrorCache error.
 
[bd] attachment store addon is nothing to do with MetaMirrorCache error.
It looks like he has both add-on installed and configured MetaMirror to copy images in posts to attachment. Then for some reason they are conflicted with each other... @DRE, please confirm if it's correct?
 
  • Like
Reactions: DRE
It looks like he has both add-on installed and configured MetaMirror to copy images in posts to attachment. Then for some reason they are conflicted with each other... @DRE, please confirm if it's correct?
That's correct.

Screen Shot 2013-09-06 at 7.58.53 PM.webp

Screen Shot 2013-09-06 at 7.59.34 PM.webp
 
Please check post #16142 of your forum to verify whether the image can be loaded. The image's URL started with "awww.elianthony.com".
Yes I see it embedded in the post and here is the direct url.

11694_awww.elianthony.com_v1_images_stories_albums_album20_IMG_7854.jpg
 
Yes I see it embedded in the post and here is the direct url.

11694_awww.elianthony.com_v1_images_stories_albums_album20_IMG_7854.jpg
So it looks like the two add-ons actually work together but for some reason, the attachment data got created twice (notice the data id in the error message 11695 and the data id in the quoted image 11694). The file has been moved for #11694 and when #11695 is created, it cannot find the file to move again... I suggest keeping an eye on this to see if it happens again.
 
If both addon is compatible, then I will purchase this one @xfrocks :)
I have just installed the MetaMirror add-on and got it working without conflict.

@DRE: Can you check the #16142 post or nearby posts to see if there is identical image? I think MetaMirror found the same URL twice but because file_exists got cached, it will go ahead and create the second attachment data thinking the image has been downloaded... May happen if a quoted post contain the image.
 
  • Like
Reactions: rdn
I have just installed the MetaMirror add-on and got it working without conflict.

@DRE: Can you check the #16142 post or nearby posts to see if there is identical image? I think MetaMirror found the same URL twice but because file_exists got cached, it will go ahead and create the second attachment data thinking the image has been downloaded... May happen if a quoted post contain the image.
With MetaMirror "Used as attachment" enabled?
 
Hey I can confirm it's working. Sorry for the inconvenience. Basically I was looking in the wrong folder. Remember, I said data/MetaMirrorCache

well it doesn't keep my stuff there. It keeps it in data/attachment-files

Sorry!

I guess it's just not done yet. I do see a lot has been done so far. False Alarm!
 
Oh wait it's not a false alarm if I'm getting a server error though.

Maybe it was just a fluke.
 
Top Bottom