[Discuss] The dangers of ASCII mode

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Ideas Centre
User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Martin Truckenbrodt » Tue Dec 09, 2014 6:01 pm

Yes.
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Volksdevil » Tue Dec 09, 2014 6:06 pm

That's good to know thanks :)

So what are the correct settings here? I know it was previously discussed, but with differing opinions? Is it safe to set default to 'Binary'? Or best at 'Auto' and then I assume that the absolute 'Must do' setting is to have the box unchecked for Treat files without extension as ASC11?
Volksdevil wrote:
wtf.PNG
Image
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
david63
Registered User
Posts: 16162
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by david63 » Tue Dec 09, 2014 6:42 pm

Volksdevil wrote:Do you mean that because my server is Linux, and my PC is using Windows that the file size differences are OK?
From my experience I would expect them to be within about 10% of each other - if one is significantly different to the other then you have a problem.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Volksdevil » Tue Dec 09, 2014 7:19 pm

Good stuff, seems I should be OK then, I think :oops:

Just done a test with a php file.
file size 8163.
Downloaded with default mode set to 'Auto' it grew to 8455.
Downloaded with default mode set to 'Binary' it stayed the same at 8163.

When uploaded, the file size on the server stays the same either way (Probably obvious)

So I'm still confused as to which default settings are best?
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
Lumpy Burgertushie
Registered User
Posts: 66320
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Lumpy Burgertushie » Tue Dec 09, 2014 8:12 pm

all text based files can be transferred as ascii ( php, html etc. ). all images and all exe, zip, doc, etc. files should be transferred as binary.

now, the easiest thing is to transfer everything as binary as it will not hurt text based files.

I have stopped using filezilla for this reason and a couple of others. However, I am a heavy ftp user so the problems I have with it would not show up with the occasional user.

luck,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Cable Player
Registered User
Posts: 516
Joined: Thu Feb 03, 2011 4:45 pm
Location: Hampshire, England

Re: [Discuss] The dangers of ASCII mode

Post by Cable Player » Tue Dec 09, 2014 10:14 pm

Lumpy Burgertushie wrote:all text based files can be transferred as ascii ( php, html etc. ). all images and all exe, zip, doc, etc. files should be transferred as binary.

now, the easiest thing is to transfer everything as binary as it will not hurt text based files.

I have stopped using filezilla for this reason and a couple of others. However, I am a heavy ftp user so the problems I have with it would not show up with the occasional user.

luck,
robert

I've always used Filezilla and my transfer setting is set to "auto" (I didn't know about the binary and ASCII transfer types before reading this, so I've learned something).

I've moved hosting providers before and haven't had any issues, but this concerns me for the future.
I guess the "auto" setting is doing it's job, but would you advise changing it to binary and using binary from here onwards?
I guess if I used a different client or host server I'd have to make sure I transfer in binary again, is that correct?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66320
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Lumpy Burgertushie » Wed Dec 10, 2014 1:16 am

the problem is only with the attachments and maybe avatars in phpbb. they are stored without an extension for some reason. that is the only problem because most attachments are going to need to be transferred in binary because they will be images or docs or some other type of binary file.

filezilla is the only one that I have ever heard of that has the default setting for files with no extenstion to be transferred in ascii.

if you use any other program it is most likely not a problem.

if you use filezilla but have no attachments that you have transferred then you would not have the problem.

since I learned that binary is safe for everything and is suggested by those in the know, I have switched it over to use binary for everything and made sure that filezilla is set properly for files with no extensions and it does the job just fine.

my personal problem with filezilla is not related to this ascii v binary situation.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
AmigoJack
Registered User
Posts: 5588
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by AmigoJack » Wed Dec 10, 2014 8:25 am

More than 3 years later and people still don't understand FTP.


The File Transfer Protocol is meant to get files from a local machine to a remote one (or vice versa). As operating systems on both machines mostly differ(ed), one feature was to automatically convert line breaks in text files (Windows uses CRLF, Unix uses LF, Mac OS uses CR, and others) so neither the user on the local machine, nor the one on the remote machine have to suffer from "foreign" line breaks using their editors.

Nowadays this is almost obsolete, as most editors can deal with all kinds of line breaks. Likewise the FTP mode (ASCII versus Binary) is not that interesting anymore as a feature. If your file size on the local machine differs from the one on the remote machine, then line breaks have been converted (on Windows text files should size the most, as their line breaks consume 2 byte, whereas on Mac OS and Unix they should size the least, as line breaks consume only 1 byte).

However, this was intended for text files only back then. Manipulating binary files always breaks them - as the corresponding bytes are not used for line breaks at all. But your FTP clients (speak: programs) can't essentially detect which files are binary and which not - file names don't help either (just because it has an extension which is .txt it doesn't automatically mean its content is textual).


Is it really that much confusing/difficult? Just switch off a feature.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

Post Reply

Return to “phpBB Discussion”