News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Attachments and Avatars missing

Started by Topman, December 30, 2015, 07:56:22 AM

Previous topic - Next topic

Topman

I am using SMF 2.0.10.

Over the last few days I have noticed that my avatars are missing.
These are the ones uploaded rather than being in the avatar folder.

So first off I tried using Repair_settings.php but all the fields are the same and nothing was changed.
I then uploaded a back up Attachments folder (June 2015) which was not downloaded using fileziller.
Again no attachments or avatars showing.

I am at a complete loss.  It seems strange it was all working then not.
I have not uploaded any mods or changed anything other than make posts.

Now it says the "The attachments upload directory is not writeable. Your attachment or avatar cannot be saved."

Does anyone have any ideas, why this happened and what I can do to get it back working.
Thanks,



tjbalon

You need to change the CHMOD for your attachments/avatars so users can write to it.

You can read more here >> http://wiki.simplemachines.org/smf/Chmod

I would try 644 on your /attachments, if not go for 755.

Topman

#2
It seems to make no difference at all changing the CMOD code using either 644 or 755.
I used filziller to change it right clicking on "attachments" and then "File Permissions"

Anyway, messing around, I found it worked on one back-up version of "attachments" I have on the server and changed the name using Repair Settings so now I can upload new avatars and images.

But all previous images in post are not displayed!

This may seem daft to even say this but I am using a new computer if that could affect anything!

Anyone else any ideas?

JBlaze

Since the attachments are serving a 404 - Not Found error, that would suggest that your attachment path settings are incorrect, or the files no longer exist.

Manually go into Admin -> Forum -> Attachments and Avatars -> Attachment Settings

Make sure the path is correct.

Then, you will need to go into your FTP program of choice, navigate to your attachments directory and make sure all the attachment files are still there. If not, you will have to restore from a backup.
Jason Clemons
Former Team Member 2009 - 2012

Topman

OK done that, the path is correct.
I opened the attachments folder in ftp and they are all named like this:
125_b43ba15f30e1e488fc40bb59336dbdf12974f293
rather than the photo file name I have given them.

I have tried to restore from a back up but the back ups are named like this too!

Illori

that is because the names are hashed for security. otherwise people may be able to call the attachments by url and hack your forum with their attachments. [was an issue before they were hashed]

a10

QuoteI opened the attachments folder in ftp and they are all named like this:
125_b43ba15f30e1e488fc40bb59336dbdf12974f293

Download (ftp) some attachments (image files) and check that they are not corrupt, should open when using windows photo viewer (or in any photoprogram when adding an extension to the hash filename, for example 125_b43ba15f30e1e488fc40bb59336dbdf12974f293.jpg)
2.0.19, php 8.0.30, MariaDB 10.6.18. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.
Stand with 🇺🇦

Topman

OK done that and I tried four image files in the forum attachments adding the .jpg to the long number and they all displayed the photo.

So not corrupted?

Any other ideas please? 
All help is very much appreciated.

a10

^^^ that's great, one possible major problem out of the equation.
2.0.19, php 8.0.30, MariaDB 10.6.18. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.
Stand with 🇺🇦

JBlaze

Have you recently installed any mods, such as an SEO URL mod, around the time the attachments started becoming unviewable?
Jason Clemons
Former Team Member 2009 - 2012

Topman

No,  I cant remember changing anything.
I first noticed my avatar was missing when I moved to a new PC and started using IE again.
I thought it was an IE thing but it was the same on Opera too, so more serious.

Paths are correct, files are there, just ownt display.
Perhaops there is a setting I don't know about or have forgotten.

I have updated to 2.0.11 but the issue of missing images was there before I updated.


a10

2.0.19, php 8.0.30, MariaDB 10.6.18. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.
Stand with 🇺🇦

Topman

I see the differences for what would be the same image file but I don't know what you are getting at.
A little more help please.

Illori

seems like the way you are rewriting the URL's is breaking the attachments. so assuming you are using a mod, try posting in the mods support topic for further help.

lurkalot

Quote from: Topman on January 02, 2016, 06:37:36 AM
No,  I cant remember changing anything.
I first noticed my avatar was missing when I moved to a new PC and started using IE again.
I thought it was an IE thing but it was the same on Opera too, so more serious.

Paths are correct, files are there, just ownt display.
Perhaops there is a setting I don't know about or have forgotten.

I have updated to 2.0.11 but the issue of missing images was there before I updated.



Thing is, for me anyway.  Your images and attachments all show up using Firefox or Chrome.  However they don't show up in IE11 This page for example http://forum.brand-newhomes.co.uk/taylor-wimpey-homes/if-you're-thinking-of-buying-taylor-wimpey-please-read/

I had a similar problem some versions back, and got the answer here. http://www.simplemachines.org/community/index.php?topic=513328.0  So might be worth a look.  ;)

Topman

Thanks for that Lurkalot.

For the benefit of others:
I upgraded from 1.1.18 to 2.0.4 and for those that know I had a s*it load of trouble doing that.
I stopped using IE8 as quite a few websites didn't load right and I couldn't upgrade IE as I had an XP PC. So I used Opera which was OK.
I then bought a new PC Windows 10 with IE11 and Edge and noticed that my image avatars were missing as were all my photo attachments!!

Lurkalot said they worked in Chrome and Firefox and that IE may be the issue.
It turns out that a bit of code in index.php should be deleted:
header('X-Content-Type-Options: nosniff');

I deleted it using Notepad++ and transferred the new file to the forum root using ftp and hey presto all my images are back again.

So a special big thank you to Lurkalot  - you're a star!

lurkalot

Quote from: Topman on January 04, 2016, 06:11:51 AM
Thanks for that Lurkalot.

For the benefit of others:
I upgraded from 1.1.18 to 2.0.4 and for those that know I had a s*it load of trouble doing that.
I stopped using IE8 as quite a few websites didn't load right and I couldn't upgrade IE as I had an XP PC. So I used Opera which was OK.
I then bought a new PC Windows 10 with IE11 and Edge and noticed that my image avatars were missing as were all my photo attachments!!

Lurkalot said they worked in Chrome and Firefox and that IE may be the issue.
It turns out that a bit of code in index.php should be deleted:
header('X-Content-Type-Options: nosniff');

I deleted it using Notepad++ and transferred the new file to the forum root using ftp and hey presto all my images are back again.

So a special big thank you to Lurkalot  - you're a star!

No problem, glad it helped.  I see them in IE11 as well now. ;)  You might need to advise your regular members to press Ctrl + F5 on their keyboards to see them, should they still not show up for them.

Topman

I would hope that most people these days have their history deleted on ****** down/exit and as such it refreshes next time they visit.

Thanks again for you help with this.

Advertisement: