all attachments are corrupted

Started by krick, January 30, 2010, 11:42:54 AM

Previous topic - Next topic

krick

I've been having some problems with my SMF 1.1.11 forum lately and I think I've managed to get it all working again except that all my attachments seem to be corrupted (12 attachments/10 thumbnails).

Any ideas what might have happened or how to fix it?


vbgamer45

How are they corrupted what happens when you download them?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

krick

Actually, I think I might have figured out what happened.

I had to restore my site from a backup and I think my FTP program transferred the files in the attachments directory as ASCII instead of BINARY.

I used BeyondCompare to do a HEX diff between a known good file and its corrupted counterpart and I see the telltale signs.  Every hex 0D in the file has a 0A inserted before it in the corrupted version.

/facepalm

I managed to recover some of the files from another backup that wasn't corrupted, but I'm still showing...

"15 attachments/avatars are being reported as the wrong filesize"

:(

vbgamer45

FTP will get you sometimes. I wonder why they even bother having two formats just be binary by default
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

krick

Amen to that.  BINARY should be the out-of-the-box default.
I've managed to recover most of the files from other backups.


MrPhil

Quote from: vbgamer45 on January 30, 2010, 12:14:28 PM
FTP will get you sometimes. I wonder why they even bother having two formats just be binary by default

Why? Because TEXT files use different formats to mark the end of each line on DOS/Windows (carriage-return/linefeed x0D0A), Mac (carriage-return x0D), and Linux (newline x0A). Whenever you transfer a text (human readable) file from one type of system to another, you have to translate the end-of-line marker to the receiving system's convention. Unfortunately, left to guess which mode to use (text/ASCII or binary) by examining the file contents, an FTP client isn't going to have a perfect record of selecting the right mode.

krick

Quote from: MrPhil on January 30, 2010, 01:05:34 PM
Why? Because TEXT files use different formats to mark the end of each line on DOS/Windows (carriage-return/linefeed x0D0A), Mac (carriage-return x0D), and Linux (newline x0A). Whenever you transfer a text (human readable) file from one type of system to another, you have to translate the end-of-line marker to the receiving system's convention. Unfortunately, left to guess which mode to use (text/ASCII or binary) by examining the file contents, an FTP client isn't going to have a perfect record of selecting the right mode.

Most modern text editors and software development environments know about the different line endings and handle them all with zero problems.  It's just people who insist on using Windows Notepad that are having problems.

Advertisement: