Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2015, 12:50 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default finding attachment

How can i find the attachment in filesystem?

Example attachment :
attachment.php?attachmentid=57356
Reply With Quote
  #2  
Old 11-08-2015, 02:52 AM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

look in the ACP under attachments. Are you even storing them in the File System? The files are given a numeric name, so you cannot just browse the file system and find them.

If you are storing in the FS (and not in the DB) you can search the DB (attachments table) to find the path. Or in the ACP you can Search Attachments, and get the ID that way
Reply With Quote
  #3  
Old 11-10-2015, 05:30 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The attachments are stored in the File System.

When I go to the forum, the attachment link is: attachment.php?attachmentid=57356

How can I find the attachment in the attachment directory?
Reply With Quote
  #4  
Old 11-10-2015, 04:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

They are stored by userid. So, go to the attachment directory and if the userid is 1234, then look in the directory /1, then in /2, then in /3, and then in /4 and it should be in there.
Reply With Quote
  #5  
Old 11-11-2015, 08:45 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most attachment from certain user arent showing anymore. I tried searching the filenames via SSH but they are on different directories. Scattered everywhere in different USERIDs.

Manually moving of the attachment files (.thumb and .attach) doesnt make the attachments show.
How can I make the attachments work again? Simply moving the files didnt work..
Reply With Quote
  #6  
Old 11-11-2015, 09:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You cannot just go moving attachments from one directory to another.

What is the exact problem you were having when you started this thread? You never said exactly. I simply told you were the attachments were stored. To get the actual .attach and .thumb number, you need to look at the attachment table, look up the attachmentid and get the filedataid. They will be listed as filedataid.attach and filedataid.thumb in the file system.
Reply With Quote
Благодарность от:
Dragonsys
  #7  
Old 11-12-2015, 02:42 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you recently upgraded to 4.2.3?
Reply With Quote
  #8  
Old 11-12-2015, 03:10 PM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You cannot just go moving attachments from one directory to another.

What is the exact problem you were having when you started this thread? You never said exactly. I simply told you were the attachments were stored. To get the actual .attach and .thumb number, you need to look at the attachment table, look up the attachmentid and get the filedataid. They will be listed as filedataid.attach and filedataid.thumb in the file system.
Its in post #5
Most attachment from certain users arent showing anymore. I tried searching the filenames via SSH but they are on different directories. Scattered everywhere in different USERIDs.

Quote:
Originally Posted by squidsk View Post
Have you recently upgraded to 4.2.3?
Yes you are correct..
Reply With Quote
  #9  
Old 11-12-2015, 03:34 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's a bug in 4.2.3 where attachments get deleted on upgrading to 4.2.3. In previous versions of vbulletin there was a bug in the daily cron cleanup script that prevented unused attachments from being deleted. That bug was fixed in 4.2.3. The problem was the refcount field in the filedata table could have incorrect values in it, specifically 0 (i.e. unused filedata) when it shouldn't, making vbulletin think an attachment isn't being used when it in fact is being used.

So when the bug preventing unused filedata from being removed was fixed it removed all unused filedata which included the filedata with bad refcounts. Short of having a backup of the attachments directory from before the upgrade there's no way to recover the lost attachments.
Reply With Quote
2 благодарности(ей) от:
chikuru, Dragonsys
  #10  
Old 11-13-2015, 02:46 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by squidsk View Post
There's a bug in 4.2.3 where attachments get deleted on upgrading to 4.2.3. In previous versions of vbulletin there was a bug in the daily cron cleanup script that prevented unused attachments from being deleted. That bug was fixed in 4.2.3. The problem was the refcount field in the filedata table could have incorrect values in it, specifically 0 (i.e. unused filedata) when it shouldn't, making vbulletin think an attachment isn't being used when it in fact is being used.

So when the bug preventing unused filedata from being removed was fixed it removed all unused filedata which included the filedata with bad refcounts. Short of having a backup of the attachments directory from before the upgrade there's no way to recover the lost attachments.
We have backup of the forum directory including the attachments folder prior to upgrade. Is it possible to recover the attachments using that copy?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04208 seconds
  • Memory Usage 2,262KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete