Large Attachment Files from Forum Threads on Server

Alfuzzy

Well-known member
I'm doing some website server investigation/maintenance...and I'm discovering a bunch of what look like large attachment files...and I'm trying to decide what to do with them.

These files are found in the server directory:

public_html > internal data > attachments

An example filename looks like this:

14128-0775c4965ca293b348511f31244a0603.data

If I download this file locally...and do a "get more info" on the file...in the file info that's given...I can see a mini example of what the attachment file looks like (a thread post image attachment).

What I'd like to know is:

1. Is there an application that I can open these files with?
2. Is there a way of finding out where each of these attachments is located on the forum (which thread/thread post)? If I knew this...then I could work with the attachment file more directly.

Thanks
 
WOW...super helpful info Brogan. Thanks much!:)

After years using Xenforo...I've never actually been in this area of the ACP. Really really nice this area can take you directly to the thread post/attachment in question!

One more question please. In my ACP...I don't get the "All" option for sorting the attachments...I only get "Most Recent" and "Largest":

ACP Attachments.webp

I'm running XF version 2.2.5...was this something possibly added in a more recent version of XF...or am I doing something wrong?

Thanks
 
What I'd like to know is:

Is there an application that I can open these files with?
Those files are the binary attachment, you can open them with any editor (though most likely that will not be very usful).

In most cases it does make sense to open them with an application that is sepcifically designed to handle the file type, eg. open an image with an image editor, an archive with an archive tool, a spreadsheet with a spreadsheet editor, etc.

To do so you need to know the filetype, eg. for 14128-0775c4965ca293b348511f31244a0603.data execute the following query:
Code:
SELECT filename FROM xf_attachment_data WHERE data_id = 14128

This gives you teh original filename which should allow to identify the filetype (in most cases).
Is there a way of finding out where each of these attachments is located on the forum (which thread/thread post)? If I knew this...then I could work with the attachment file more directly.
Yes, execute the following query

Code:
SELECT content_type, content_id, attachment_id FROM xf_attachment WHERE data_id = 14128

This gives you the content type (post, etc.), the content id and the attachment id.
 
Thanks much Kirby. Some great "higher level" info there.

In most cases it does make sense to open them with an application that is specifically designed to handle the file type, eg. open an image with an image editor, an archive with an archive tool, a spreadsheet with a spreadsheet editor, etc.
As far as an application to open these files directly...yes of course it makes sense to open a file with the appropriate application designed to open that file type.

In this case with this sort of file name & file extension:

14128-0775c4965ca293b348511f31244a0603.data

...was hoping there was an application that would open them up directly. Since I'm 99% sure these attachments are mostly image attachments...the original file types would be .jpeg, .png, .gif, etc.

The solution Brogan posted should get the job done for most of what I want to do. But if you knew a way to open these files directly (14128-0775c4965ca293b348511f31244a0603.data)...I'm sure this would help too.

Thanks:)
 
The solution Brogan posted should get the job done for most of what I want to do. But if you knew a way to open these files directly (14128-0775c4965ca293b348511f31244a0603.data)...I'm sure this would help too.
Not sure what "open these files directly" does mean to you?

As posted in my previous reply, you can open those files with any text editor - but unless they are text files that would most likely not provide much useful insight.

If you want to "directly open those files" with an appropriate application - that's possible, just open them ... with an appropriate application ;)
Doing that requires to know the filetype which can be "determined" (more precicely: guessed) with tools like file (on UNIX-like OS).

Another option would be to guess the filetype from the original filename as explained in my previous post.

If you expect the file(s) to be images you can just (try to) open them with your favourite image viewer / editor.
 
Thanks much Kirby.:)

Not sure what "open these files directly" does mean to you?
What this means to me is...double-clicking on the file...and it's opened by an application that resides on a computer already (I mentioned this in post #1).:)

Of course if I don't have the appropriate application installed...and it is possible to open these files directly...then I was hoping someone would be able to tell me what the appropriate application is (then I would download & install the appropriate application).:)

As posted in my previous reply, you can open those files with any text editor...

Not true. If this were possible with a text editor app...then I would have already been able to do this...and this thread would be partially unnecessary. As I'm sure you know...Text Editor apps are included with the basic install on any Windows or macOS computer. Thus in this case...a text editor app is not the "direct open" solution.
If you want to "directly open those files" with an appropriate application - that's possible, just open them ... with an appropriate application ;)
This is kind of a "Captain Obvious" statement...and not very helpful (unless this was my first day using a computer)...which it is not! Lol

Doing that requires to know the filetype which can be "determined" (more precisely: guessed) with tools like file (on UNIX-like OS).

Another option would be to guess the filetype from the original filename as explained in my previous post.

If you expect the file(s) to be images you can just (try to) open them with your favourite image viewer / editor.
As I mentioned above...I know most/all of the actual original files/attachments in question are images (.jpeg, .png, .gif, etc). The problem is these attachments are NOT stored by Xenforo as "image files"...they're stored in this type of file (with the .data file extension):

14128-0775c4965ca293b348511f31244a0603.data

The bottom line is...the solution Brogan advised in post #2 is the solution that will work for me.:) But if there was a 2nd solution...I'm always interested in learning new things.:)

Thanks
 
As I mentioned above...I know most/all of the actual original files/attachments in question are images (.jpeg, .png, .gif, etc). The problem is these attachments are NOT stored by Xenforo as "image files"...they're stored in this type of file (with the .data file extension):
Erm ... XenForo does not alter the type of uploaded files.

In case of non-images the .data files are exactly the original files, in case of images they might be rotated & resized versions of the originals (but a JPEG would still be a JPEG).

Or in other words: .data isn't any specific format; it's no "format" at all - it's just a neutral file extension.

To repeat myself:
Just open the files with the appropriate application (if it's an image and your are using Windows Paint might be a candidate).
Doubleclick will not work though, you have to use Right Click > Open with (Or File / Open from the application itself) as Windows does not know the filetype for .data.

Assuming that 14128-0775c4965ca293b348511f31244a0603.data is a JPEG image - just open that file as-is with Paint, Photoshop, IrfanView ... whatever application can open JPEG images.
 
Last edited:
Thanks again for trying Kirby.:)

We're obviously having some sort of communication issue...because what I'm posting & what you're posting are not being properly understood.

As I mentioned...I think what Brogan suggested in post #2 will get the job done....no need to prolong this conversation further.

Thanks:)
 
One more question please. In my ACP...I don't get the "All" option for sorting the attachments...I only get "Most Recent" and "Largest":
The All tab was introduced in a later version than you have installed ... and doesn't actually do any different than the Most recent tab does.

One of them will likely be disappearing.
 
Top Bottom