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

A guide to Xenforo attachments / photos

All about attachments / photos in Xenforo

  1. Walter

    Walter Well-Known Member

    Walter submitted a new resource:

    A guide to Xenforo attachments / fotos - All about attachments / fotos in Xenforo

    Read more about this resource...
     
    Skylined, 0ptima and ProCom like this.
  2. Teapot

    Teapot Well-Known Member

    Regarding xf_attachment_view, it's a memory-based table used for storing view data. Every time an attachment is viewed, its ID is written to that table (in memory). Then, a cron job run every hour counts the number of times an attachment's ID appears in that table and adds that count to an attachment's view_count.

    So, for example, if you have:

    31
    31
    31

    The cron job adds 3 to attachment 31's view_count. :)
     
    Walter likes this.
  3. ProCom

    ProCom Active Member

    Brilliant resource! My main questions were answered:
    • I only see an upload folder called "0"? A new folder is created every 1,000 images. Cool!
    • How do I balance super large files without frustrating my members? Set a max image dimensions /size so the images will auto-resize!
     
  4. ProCom

    ProCom Active Member

    I do have a follow up question: Why are images stored in such a weird way in the DB, e.g., 92-e5135059d8413ce519245f0c7d59ea4e.data

    Why aren't images uploaded with native extensions like jpg, gif, etc?
     
  5. ProCom

    ProCom Active Member

    Also, related to the above: Say I have a file in my folder called: 92-e5135059d8413ce519245f0c7d59ea4e.data and it is 15 mb in size.
    1. How do I figure out who uploaded the file, if / where it was posted on my forum (thread, resource, etc.)?
    2. How do I determine what type of file it is? A zip, a big picture, a PDF?
     
  6. 0ptima

    0ptima Well-Known Member

    Thanks for posting this!
     
  7. David Denton

    David Denton Member

    Is it possible to change thumbnail storage path?
     
  8. ProCom

    ProCom Active Member

    A quick follow up on these questions:
    1. How do I figure out who uploaded the file, if / where it was posted on my forum (thread, resource, etc.)?
    2. How do I determine what type of file it is? A zip, a big picture, a PDF?
    3. Why are images stored in such a weird way in the DB, e.g., 92-e5135059d8413ce519245f0c7d59ea4e.data vs. being uploaded with native extensions like jpg, gif, etc?
    For example, I have a 13mb file in my attachments folder and I have no idea what it is, if it still needs to be there, who uploaded it, etc.

    Thanks!
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    The first part of the file name, e.g. 92 in the example above is the data ID.

    If you perform this query:

    Code:
    SELECT attachment.*, attachmentdata.*
    FROM xf_attachment AS attachment
    INNER JOIN xf_attachment_data AS attachmentdata ON
        (attachment.data_id = attachmentdata.data_id)
    WHERE attachment.data_id = 92
    That will give you all details about the attachment. There's several columns. Including the extension, file size.

    The latter part of the filename is the file_hash which you will also see matches up in the database.
     
    ProCom likes this.
  10. ProCom

    ProCom Active Member

    Thanks Chris, I'll give it a try!

    I wonder why each file is renamed like this vs. just maintaining filetype?
     
  11. Skylined

    Skylined Active Member

    Thanks, I didn't know this and it has solved my attachment problems! :)
     
  12. Walter

    Walter Well-Known Member

  13. John007

    John007 Active Member

    Hello Walter i have used your setting from this post.

    But i try and upload a 3.2mb 5000x5000pixel photo and it says error the photo you uploaded is to large

    please help me thanks
     
  14. Martok

    Martok Well-Known Member

    You missed this bit in the guide.

    And from the XenForo manual it linked to

    As 5000 x 5000 = 25,000,000 it's bigger than the default, so you'll need to increase this value.
     
    maszd, viper357 and 0ptima like this.

Share This Page