[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!
Suggested Hosts
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 »

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: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Volksdevil »

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 :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [Discuss] The dangers of ASCII mode

Post by david63 »

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!

I now no longer support any of my extensions but they will start to become available here
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Volksdevil »

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 :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Lumpy Burgertushie »

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
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
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 »

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: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Lumpy Burgertushie »

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
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by AmigoJack »

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 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." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
Sajaki
Registered User
Posts: 1390
Joined: Mon Mar 02, 2009 1:41 pm
Location: Amsterdam
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Sajaki »

i just ran into this https://trac.filezilla-project.org/ticket/10954 bug myself.
I restored my site from localhost and didn't change the default. luckily i had local backups and re-uploaded extensionless files in binary.
really strange that after five years noone at Filezilla picked this up.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by 3Di »

Nobody should use Filezilla as a thumb of rule.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3732
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: [Discuss] The dangers of ASCII mode

Post by Kailey »

That ticket is 5 years old and this topic is 10. Please don't bump topics that have long since died. As 3Di has stated, as a general rule, try to avoid FileZilla.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
Locked

Return to “phpBB Discussion”