Advertisement:

Author Topic: Bad links for SOME attachments  (Read 257 times)

Offline SethStudent

  • Semi-Newbie
  • *
  • Posts: 33
    • Speaking of Seth
Bad links for SOME attachments
« on: November 03, 2019, 06:26:17 PM »
Just found out from a new member that some of my forum's attachments are "missing." He pointed out two image attachments in a post from last year. They had been viewed several times, and suddenly would not open. The URLs looked ok. I downloaded the Attachments folder and the images were in there, I was able to open them in Photoshop. I renamed them and replaced the broken ones and they are fine now.

The member just now said there are a LOT of attachments missing, but didn't give me a list. The attachments look ok in the Browse Attachments list, so I can't tell which links are bad.

I ran repair_settings and everything was set to the recommendations.

Has anyone heard of this before? Short of me looking at every one of the 12,000+ posts and replacing some of the images, is there a maintenance thing I can run to have the links repaired?

I have not added any new mods for years, everything seems to be up to date. https://speakingofseth.com

Offline SethStudent

  • Semi-Newbie
  • *
  • Posts: 33
    • Speaking of Seth
Re: Bad links for SOME attachments
« Reply #1 on: November 08, 2019, 06:02:32 PM »
Sorry to bring this up again, but it's been a while with no response. I came across another post today on my forum where while the attachments had been viewed in the past, suddenly the links are broken: 404 - Attachment Not Found

Image browser URLs from clicking the links:

https://speakingofseth.com/index.php?action=dlattach;topic=1375.0;attach=2046

https://speakingofseth.com/index.php?action=dlattach;topic=1375.0;attach=2048

The images were in the Attachments folder. I was able to open them in Photoshop so they are not corrupted. I'm attaching a composite of screen captures showing the attachment files in various places (folder, database, Browser).

Any idea how I can fix this? Not all attachments on my forum have broken links, just an unknown percentage at this point. There are 2000+ attachments and 12,000 posts and I can't look at every single one of them.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,390
Re: Bad links for SOME attachments
« Reply #2 on: November 08, 2019, 10:04:14 PM »
There was a change in 2.0 database around 2.0.6 involving mime_type in smf_attachments table.  If mime_type is empty, attachment will not load.  Attachments posted after the change will load correctly.  Look in your database, see if bad attachments have empty mime_type.  If that's the problem, you can run database query to fix it.

Offline SethStudent

  • Semi-Newbie
  • *
  • Posts: 33
    • Speaking of Seth
Bad links for SOME attachments - a challenge
« Reply #3 on: November 09, 2019, 11:38:51 AM »
Thanks for the idea. I did take a look at the db and can't see anything different about the attachments that are broken compared to the working ones (mime_type is there), but I'm no db whiz. I did a screen capture of several rows, maybe someone else with more experience can spot a discrepancy. Attachments up through 2054 have bad links (images, pdfs, html, txt, doc or avatars). After 2054, they work.

The date of 2054 is 6/9/18. The next attachments were added on 07/16/18. There were four of them added at approximately the same time/same post: 2059, 2061, 2063 are ok, 2057 is not. After that the rest of the attachments appear to be fine.

I looked at dates in the Package directory thinking maybe I did a patch or something around 07/06/18 that would affect the db, but no. 2.0.12 and .13 were installed Feb 2017. 2.0.14 and .15 were installed 08/20/18.

Any suggestions would be greatly appreciated. Needless to say, this is upsetting.