vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to identify a file to attachment id ? (https://vborg.vbsupport.ru/showthread.php?t=322092)

ka81 03-12-2016 06:55 AM

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

Dave 03-12-2016 07:41 AM

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.

ka81 03-12-2016 07:48 AM

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

Dave 03-12-2016 07:52 AM

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.

ka81 03-12-2016 08:06 AM

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?

Dave 03-12-2016 08:34 AM

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.

ka81 03-12-2016 08:48 AM

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

Dave 03-12-2016 08:58 AM

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.

z3r0 03-12-2016 09:08 AM

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.

ka81 03-12-2016 09:16 AM

Quote:

Originally Posted by z3r0 (Post 2567062)
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?


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01185 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete