Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 03-12-2016, 06:55 AM
ka81's Avatar
ka81 ka81 is offline
 
Join Date: Mar 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to identify a file to attachment id ?

Hello

Could someone tell me please is there any easy way to find a file by ID ?

for example I see link to attachment - /attachment.php?attachmentid=72697&d=1390755704
but the file name is /customattachments/9/4/7/2/8/67174.attach

So, how/where to get that info in most easy way (like some search field or a table or ...) ?

Thank you
Reply With Quote
  #2  
Old 03-12-2016, 07:41 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

9/4/7/2/8 > 94728 in the path of the file on the server is the userid of the user.
72697 is the attachmentid in the attachment table.

You could query SELECT userid FROM attachment WHERE attachmentid = 72697 to get the userid.
Reply With Quote
  #3  
Old 03-12-2016, 07:48 AM
ka81's Avatar
ka81 ka81 is offline
 
Join Date: Mar 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont need the user id. i can see who posted attachment. i need to know the name of real file if i know only like this - /attachment.php?attachmentid=72697
Reply With Quote
  #4  
Old 03-12-2016, 07:52 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's stored in the same table as filedataid.
SELECT filedataid FROM attachment WHERE attachmentid = 72697

The filedataid should be the name of the .attach file.
Reply With Quote
Благодарность от:
ka81
  #5  
Old 03-12-2016, 08:06 AM
ka81's Avatar
ka81 ka81 is offline
 
Join Date: Mar 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sorry, I just don't get it - what to do exactly?!..
could you please provide me with step-by-step instruction?
Thank yoy anyway!

--------------- Added [DATE]1457777231[/DATE] at [TIME]1457777231[/TIME] ---------------

So, I see link /attachment.php?attachmentid=72697 in post.
I go to /admincp/queries.php?do=modify
what exactly should I do there?
Reply With Quote
  #6  
Old 03-12-2016, 08:34 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You execute the query I posted in my previous post. You will then see the filedataid which belongs to the attachment which you can then use to track the file on the server.
Reply With Quote
  #7  
Old 03-12-2016, 08:48 AM
ka81's Avatar
ka81 ka81 is offline
 
Join Date: Mar 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
SELECT filedataid FROM attachment WHERE attachmentid = 72697
Quote:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'vb.attachment' doesn't exist
Reply With Quote
  #8  
Old 03-12-2016, 08:58 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you use a table prefix? (You can check that in the includes/config.php file). You have to prepend that prefix to "attachment".

So if your prefix is "ka81_" then you should change it to ka81_attachment.
Reply With Quote
  #9  
Old 03-12-2016, 09:08 AM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whenever I need to find a file from ID I just put the number in to the vbulletin search and check the post it's in.
Reply With Quote
  #10  
Old 03-12-2016, 09:16 AM
ka81's Avatar
ka81 ka81 is offline
 
Join Date: Mar 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by z3r0 View Post
Whenever I need to find a file from ID I just put the number in to the vbulletin search and check the post it's in.
I nkow post! I know even author!
I CAN NOT see what file was for that attachment!


it says - Invalid Attachment specified. If you followed a valid link, please notify the administrator
and that's all, no more any info!!!

--------------- Added [DATE]1457781656[/DATE] at [TIME]1457781656[/TIME] ---------------

Dave
thank you very much!

but what if query don't give any result?
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:36 AM.


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.06612 seconds
  • Memory Usage 2,247KB
  • 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
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete