• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Attachment Storage Scheme

Brad L

Well-known member
#1
How exactly are attachments stored in the filesystem? Does each member have their own directory like vbulletin, or are there shared directories? I have a xenforo forum under development, and the few existing members' attachments are all located here:
/data/attachments/0/
/internal_data/attachments/0/

I realized earlier today that my file permissions for the data and internal_data directories were incorrect, so I'm not sure if this is intended behavior or an effect related to the incorrect permissions.
 

Brogan

XenForo moderator
Staff member
#2
There is one main directory, with sub-directories containing 1000 files.

The /data/attachments directory is for the thumbnails.
The /internal_data/attachments directory is for the original images. This directory is php protected which enables the contents to be restricted to certain groups/users using the permission: View attachments to posts.
 

Brad L

Well-known member
#5
Thanks for the quick replies. Are you two saying that the folder names (/internal_data/attachments/0/) have nothing to do with a member's userid?
 

James

Well-known member
#6
The 0 is the group they belong to. The first 999 attachments will have /0/, then 1000-1999 will have /1/, then 2000-2999 will have /2/, etc.
 

trilogy33

Well-known member
#8
When a post is permanently deleted, any attachments within get removed from the server too right?
I thought this was the case as to not leave orphan files everywhere?