News:

Wondering if this will always be free?  See why free is better.

Main Menu

The files were damaged after upload

Started by touu, April 08, 2011, 04:22:04 AM

Previous topic - Next topic

touu



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

Is the new forum on the same site as the old one?

Arantor

They were downloaded as ASCII and reuploading them won't fix that, no matter how they are uploaded.

kat

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

"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

Just to expand this, a bit...

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

MrPhil

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

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. :)

Advertisement: