Advertisement:

Author Topic: The files were damaged after upload  (Read 3864 times)

Offline touu

  • Semi-Newbie
  • *
  • Posts: 12
The files were damaged after upload
« on: April 08, 2011, 04:22:04 AM »


Dear Sir/Madam,

I'm SMF user 1.1.13.  Right now I have a big problem!
I would like to create a new forum using old data base.
Everything was done except the attachments.
After I uploaded the attachments, they were damaged and could not show.
I have tried both Binary & ascll methods, but the same result was obtained.
I would like to know how I can fix this problem.
The picture is the sample of that problem.

Thank you very much
Best regards,

kat

  • Guest
Re: The files were damaged after upload
« Reply #1 on: April 08, 2011, 06:50:19 AM »
Is the new forum on the same site as the old one?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,459
    • StoryBB/StoryBB on GitHub
Re: The files were damaged after upload
« Reply #2 on: April 08, 2011, 07:00:48 AM »
They were downloaded as ASCII and reuploading them won't fix that, no matter how they are uploaded.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

kat

  • Guest
Re: The files were damaged after upload
« Reply #3 on: April 08, 2011, 07:06:59 AM »
You know...

I always thought the "transfer type" setting only affected uploads. (God knows why).

Oddly enough, Total Commander doesn't even give you the option between the two.

Just Passive mode, or not.

I guess it's set as binary for everything.

MrPhil

  • Guest
Re: The files were damaged after upload
« Reply #4 on: April 09, 2011, 07:50:07 PM »
"binary" both ways will never corrupt a file, but it may limit your choices with doing anything with a file on the intermediate platform (usually your PC). For example, a .php file downloaded from a Linux server will not be in the standard Windows text format (all the lines will be run together), which limits which editors you can use.

"ASCII" is dangerous when you have a "binary" file (images, compressed/zipped files, executable programs such as .exe, etc.) -- anything not human-readable text -- and you're moving a file between systems of different types (Windows/Linux/Mac). If any of several specific characters or sequences appear by chance in the file (e.g., 0x0D0A in a .jpg file on a Windows PC), they will be translated (e.g., to 0x0A on a Linux server). This is usually irreversible, as there are other native "target" characters that you won't know whether they can be translated or not when moving the file back down to the PC (i.e., not all the 0x0A bytes you see in the corrupted image should be translated [back] to 0x0D0A).

Your best bet is to always transfer in "binary", and if you want to edit a human-readable text file on your PC, get an editor (such as ViM) that will view/edit Linux-format text files on a PC. Some editors may even give you a choice of saving the file in either format. Notepad/Wordpad/Word will not be able to handle "binary" transferred files.

kat

  • Guest
Re: The files were damaged after upload
« Reply #5 on: April 10, 2011, 05:11:31 AM »
Just to expand this, a bit...

In which cases would it, actually, be useful to use ASCII?

MrPhil

  • Guest
Re: The files were damaged after upload
« Reply #6 on: April 10, 2011, 12:59:10 PM »
If you want to upload/download a human-readable file (such as .php), and do work on it on your PC, you would want to transfer in ASCII (text). That is, unless you get a decent editor that can handle Linux text files, in which case just leave transfer at binary. Or, you want to use the file permanently on your PC, so it needs to be in normal Windows format, you would want ASCII transfer.

kat

  • Guest
Re: The files were damaged after upload
« Reply #7 on: April 10, 2011, 01:07:10 PM »
Ah. Ta, for that.

I'd never realised that, because my text editor "Textpad" handles anything, pretty well.

Been using it for years and I kinda love it, in a strictly non-gay and manly way. ;)

So, I just get everything in binary and let things go there own, sweet way. :)