Jump to content

renaming attachments with wrong filename

Luis Manson

Recommended Posts

From some time after the ipb4 upgrade i get a lot of 404 from attachment files. after further inspection i have tracked the issue to not renamed files, they do exist with attach_file instead of attach_location.

 I want to make a script to walk core_attachments and rename files not renamed, since i do have both parameters. However there is one thing i can not understand


In filesystem i have stored: /uploads/monthly_07_2013/Some File.pdf.7886fc68f0a15895a1afcb6f463eb0cc

I have no idea where that hash comes from, and how to match efficently.

    "attach_id": "36647",
    "attach_ext": "pdf",
    "attach_file": "Some File.pdf",
    "attach_location": "monthly_07_2013\/post-21243-0-80182800-1372864076.ipb",
    "attach_thumb_location": "",
    "attach_thumb_width": "0",
    "attach_thumb_height": "0",
    "attach_is_image": "0",
    "attach_hits": "130",
    "attach_date": "1372864076",
    "attach_post_key": "",
    "attach_member_id": "21243",
    "attach_filesize": "2864122",
    "attach_img_width": "0",
    "attach_img_height": "0",
    "attach_is_archived": "0"


    "attachment_id": "36647",
    "location_key": "forums_Forums",
    "id1": "80549",
    "id2": "1194315",
    "temp": null,
    "id3": null


Link to comment
Share on other sites

  • 1 year later...

Nevermind, I fixed this myself. For some reason the 4.1 install went back into my 3.4 install and moved all the .ipb files out of the /uploads folder so my 3.4 had all the attachments there but no attachment data for the posts. So all I did was copy everything back.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...