Hi there.
I've found several people with the same problem after upgrading from SFM 1.x to SMF 2.x but I haven't found a satisfactory answer to this "serious" problem.
I have 7000 attachments and when I upgraded, in localhost and on live forum, almost 3 thousand disapppeared.
I don't have a clue why, but al atttachments were working and they are still in my attachments directory.
The attachments' table in the database is also intact.
Any lights on this?
Thanks.
Got a link to a post where this is happening, so we can have a look at it? (Remember it'll need to be open for guest viewing)
I'm analysing my old vs new database (attachment table) and I see something weird. All the old attachments don't have a file_hash, while the attachments that are ok do have a file_hash.
But I wonder why this was not an issue in SMF 1.1.18...
Any clue about this?
I really didn't want to upload 3000 attachments again :(
My forum is in maintenance mode, but i can explain exactly what you want to see if you wish.
Quote from: K@ on February 12, 2013, 11:17:43 AM
Got a link to a post where this is happening, so we can have a look at it? (Remember it'll need to be open for guest viewing)
I detected a difference between the old and new attachments. Clearly a codification problem :-\
old hash ->
6553_Oea_Coaao_Eiaeai_Oaeiwau_199u_EIC_oao77ab11ea32cba108db8292a2a13f5a2b
6552_Oea_Coaao_Ciiaai_Waoieic_Oweiaia_2007_AODH_oaoc8aa15609d48e322240eeac091c31c56
6551_Oea_Coaao_Aoaadha_Oea_AEieceo_oi_AEoaaaii_2001_EIC_oaob48deeac0802547da7369a99a9d71307
new hash ->
6554_1bf7f29acc47fccdd9311d5d2b27577b7706a718
6555_029e9bbe42fdba0bd7e9684aa510df6b02bf3c07
6556_ff01e92a67b8b877fa3ac592822e2b9fd83e5b5e
Did you change from ISO to UTF-8 at any point?
That's a thought, innit?
I wondered if PrettyURLs might be involved, somewhere, too.
All I was going to try, to start with, was the ol' "Inspect element" thing.
Check a URL or two, that kinda thing.
Generally, a 404 means that the page simply doesn't exist.
A small hunchette... The attachments directory and the actual files, themselves... Are they all read-enabled?
Could it be a CHOWN permissions thing?
Yes, when I upgraded I used "Convert HTML-entities to UTF-8 characters" in the admin panel. Could it be because of that?
Quote from: Arantor on February 12, 2013, 11:43:06 AM
Did you change from ISO to UTF-8 at any point?
My attachments directory is 0755 and all the files inside are 0644.
I don't have prettyurls or SimpleSEF installed...
Quote from: K@ on February 12, 2013, 11:47:37 AM
That's a thought, innit?
I wondered if PrettyURLs might be involved, somewhere, too.
All I was going to try, to start with, was the ol' "Inspect element" thing.
Check a URL or two, that kinda thing.
Generally, a 404 means that the page simply doesn't exist.
A small hunchette... The attachments directory and the actual files, themselves... Are they all read-enabled?
Could it be a CHOWN permissions thing?
What you've quoted is CHMOD, not CHOWN.
Your host will have to confirm that you have full CHOWN ownership of everything.
Well, but there's no reason for being a problem with CHOWN, since I did the upgrade in the same server, and the attachments folder didn't change, because I didn't touch it. That folder was doing just fine UNTIL I did the upgrade.
/me wanders-off, scratching his head, to try and figure this out...0
Ok, I've installed the forum in my pc like it was before the upgrade, and all attachments are correct and working fine.
I'm going to upgrade on localhost and see if I get the same results, this time without activating the "Convert HTML-entities to UTF-8 characters" afterwords.
And don't use FileZilla to transfer attachments ;)
Ok, tested and proved.
After the upgrade I went directly to the attachments zone, and the problem is there.
Like I said here (http://www.simplemachines.org/community/index.php?topic=497289.msg3489270#msg3489270), old attachments don't work. :(
PS: I use Total Commander, although I think that's not the problem...
I use that, too. It's perfectly OK, for this kinda stuff.
This sure is an odd one.
I've just come across this issue on one of my live forums using 2.0.1, going to digg deeper and see what I can come up with.
I've had a look into this more. All the files in the attachment directory are named 'ID_Hash' and the references in the attachment table match the Id and the file hash. Can't seem to see why it's not working all of a sudden. :S
Well, my job is not finished yet... I'm still uploading like 20 attachments per day to correct this. :(
Had any luck, so far?
I've come up with nothing, some attachments work but most don't, can't see anything causing it or anything common between failing attachments.
This sure is weird, innit?
If it was Filezilla's "Transfer type" feature, I could understand it. But, we've been through that, haven't we?
One thing I remember, from AGES back, is that Total Commander went through a phase of subtly renaming things, when I uploaded them, by changing the case of the filename. I managed to figure-out why. But, it's so long ago that I can't remember what I did, to correct that.
It's not that, is it?
I haven't used an ftp application at all, these are files that were attached through SMF and left in the attachments directory.
Ah, right. So, just doing the upgrade toasted them?
Now that IS weird.
Any connection with the attachment filetypes?
Were they all jpg, or something else, perhaps?
All different file types, no similarities across them all.
I'm out of ideas. :(
I'll flag it in the "Helpers" board. :)
There is or have been a bug somewhere at some point during the updates/upgrades, don't know.
It's not the first time that I see the attachments hashes messed up, last time I tried to fix with a script that was supposed to re-hash the files, but I think I had problems and due to my lag spiros completed the re-upload before I was able to provide a working script.
Try the attached file, it *may* work, no warranties.
Try it locally of course first and take a full backup because it changes both the database and the attachments directory.
In order to use it you have to download one of the SMF converters (for example this (http://www.simplemachines.org/community/index.php?topic=477019.0)), extract it and upload the file convert.php along with the file attached here to your forum directory.
Then from your browser go to http://localhost/forum/convert.php or the appropriate host and directory. Let the converter run. See if it fixed anything.
Ta, Manny-baby! :)