vBulletin Mods

The Official vBulletin Modifications Site

How to identify a file to attachment id ?
by ka81
12 Mar 2016 08:55


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 12 Mar 2016 09:41

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 12 Mar 2016 09:48

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 12 Mar 2016 09:52

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 12 Mar 2016 10:06

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 12 Mar 2016 at 10:07 ---------------

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 12 Mar 2016 10:34

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 12 Mar 2016 10:48

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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 12 Mar 2016 10:58

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 12 Mar 2016 11:08

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 12 Mar 2016 11:16


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 12 Mar 2016 at 11:20 ---------------

thank you very much!

but what if query don't give any result?

All times are GMT. The time now is 02:27.

Powered by vBulletin® Version 3.8.13
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.