PDF problems? Check your filenames

We have been contacted a couple of times recently by content maintainers who were concerned that some users of the website were unable to open PDF files. Our users have particularly been having problems opening some PDFs in Firefox, while I have also known of Google Chrome being affected. Internet Explorer has been fine (for once!).

These odd problems have only been cropping up recently, and not just on the University website. I have heard reports from other people who have been having difficulties opening PDFs in Firefox and Chrome in general. Strangely, despite hearing numerous reports “in real life”, I have seen little chat about this on the web. So I am not entirely sure what is going on. But here is what I think has happened.

What might be causing the problem?

Both of the times I have been asked to investigate this issue, the same thing appeared to be causing it. I noticed that the PDFs in question had filenames that were not web-friendly. They were something like Example File Name.pdf.

A filename that contains capital letters, special characters or spaces is quite common, and is normally adequate if you just want to open your file from your desktop. But they are unsuitable in a web environment. URLs are not designed to contain spaces. But if you upload your PDF with a filename that contains spaces, this is what will be created. This is also what causes the dreaded “%20” ugliness that we are often asked about.

For instance, if I was to upload my hypothetical document with the filename Example File Name.pdf, its URL on the web would be http://www.st-andrews.ac.uk/media/Example%20File%20Name.pdf. This is not ideal.

Normally the software we use is smart enough to work around it. But it seems (and this is just a guess on my part because I have been unable to find any firm information) that a recent update to the Adobe Reader software (perhaps the release of Adobe Reader X) has caused a few bugs in the way certain browsers handle PDFs.

How to avoid these problems — name your files correctly

Both times I have remedied the issue by downloading all of the PDFs onto my computer, renaming the files so that they had web-friendly filenames, then re-uploading them. It seems that the best way of ensuring that your PDFs will open in all browsers is to give them a web-friendly filename in the first place. As a nice bonus, they will end up having nicer URLs as well!

If you are preparing a document to be uploaded to the website, please ensure that you have a web-friendly filename before uploading it. Avoid using any special characters, capital letters or spaces.

Do ensure that your filename is all lowercase and replace any spaces with hypens.

So if you have a file that’s called Example File Name.pdf that you want to upload to the web, create a copy and name it example-file-name.pdf. Upload this new version of the file. That way, you can help prevent users having problems viewing your documents.

This advice also applies to any sort of file you are uploading, including Word documents and  images.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s