Browser fun

A few known browser-related problems on Queen’s systems:

  • Safari may save files with strange looking names from Exchange 2010 webmail
  • Firefox version 30.0 and later will not connect to QOL as it has dropped support for the NTLMv1 authentication scheme used due to security concerns. Either use Firefox 24.0 LTS release or switch to another browser. On OS X Safari supports the secure NTLMv2 protocol. It is possible to set a hidden preference to re-enable NTLMv1 if you really must…
  • Scrolling around the QOL home pages produced using Sharepoint is impossible in Chrome due to the “questionable” HTML Sharepoint produces. If you search for “Sharepoint Scrolling” in the Chrome Extensions store you can find a few third-party solutions.

%20, the final frontier…

The university is in the process of upgrading staff email servers from Exchange 2007 to Exchange 2010, and then onwards to 2013 thereafter. This is a positive move for non-Windows users as the more recent versions of Exchange have much better support for web browsers other than Internet Explorer, and also seem to fix issues such as the ‘mail attachments not showing in Apple Mail’ bug. However, as with any update there are issues. This one I found out about a few months ago while assisting a colleague in Medicine who had an account at their former institute, where they ran Exchange 2010.

The problem, as first reported to me, was “every file has the spaces in the filename replaced with % signs” which was indeed puzzling. On closer inspection it turned out that the problem did not affect every file, just those coming from the Exchange 2010 webmail client, and that the spaces were being replaced with %20. At this point I realised what was happening.

To explain this we need to step back a moment. Once upon a time filenames were typically something.txt or image.jpg – very simple and with no fancy characters. Then deviant Mac and Unix users started using other characters in their filenames, and soon Windows followed suit (hello Windows 95). This is fine in most cases, but gives a problem for web browsers which don’t deal well with spaces in URLs. For example, this won’t work:

http://www.example.com/documents/My Lovely Horse.mp3

as the browser will ask for the file ‘My’ instead of ‘My Lovely Horse.mp3’

Rather than have people rename all their files, web servers use percent codes to encode these characters. The % symbol is used to denote the start of an escape sequence, and is followed by the ASCII or Unicode number of the escaped character. In this case, space is ASCII character 20, so the URL above becomes

http://www.example.com/documents/My%20Lovely%20Horse.mp3

which is less readable for humans, but much better for computers.

Getting back to the point, when someone sends an email with an attachment whose filename contains spaces, the Exchange webmail client will present this file with the filename percent encoded. If you try to download the file via webmail then things get ‘interesting’. Some browsers, such as Safari, will literally save the attachment with the exact name presented, %20 and all. Others, like IE, Firefox, and Chrome, will convert the percent encoded characters to their normal equivalents. Which is the ‘right’ thing to do is a matter of opinion, but the latter is clearly more convenient for users!

If you’re struck with this issue you have a few choices:

  1. Don’t use webmail
  2. Don’t use Safari
  3. Use Automator to create a droplet which does the necessary renaming

In most cases option 2 is the better one, with Chrome being my alternate browser of choice since Firefox currently chokes on QOL authentication. Option 3 is not that difficult but beyond the scope of this blog post!

I did some Googling around this problem and saw there were other possible solutions involving server-side configuration and hacking about with Safari extensions, but those all seemed too much effort for either server admins or users!