CMS Tip: Avoid Spaces in File Names

Posted on 12/1/2016 4:32:00 PM

This is part of a series of tips for web maintainers. The Web Team posts hints and tips about the CMS, MyIUP, IUP Mobile, and the interactive map each week.

Avoid Spaces

If you've ever tried to use Facebook to share a page or a news post from your site and the image doesn’t show up, the culprit might be a space in the filename. Facebook will not recognize an image (or other file types) that contain a space, and therefore will not display it when you share.

The fix is easy: just avoid spaces (and other special characters listed below) when you are naming your image. The same rules apply to videos, PDFs, text documents, and more. Use a dash (-) instead to separate words in your filename.

Facebook share screenshot

What you should see when you share a news post on Facebook, shown above. In this example, the image in the news item does not have any spaces or special characters in the filename. 

Updating Images in the CMS

If you have an image in the CMS that has spaces in its filename, you can upload a new, correct one. But, you’ll need to remove the old version from your page and then place the new image. While you can update an image by overwriting it through the library, it retains the original file name—with spaces—so you will still experience the issue unless you actually upload as a new image and place that in your page.

Characters to Avoid

Best practice is to avoid spaces and special characters in file names. There are many technical reasons to avoid these characters, but the basic reason is the same: they might break something! A comprehensive list is available on Apple’s support site, and includes explanations as to why you should avoid the characters. Below are some common ones to avoid:

  • Spaces
  • Number Sign (#)
  • Percent (%)
  • Ampersand (%)
  • Asterisk (*)
  • Brackets ({}, [])
  • Forward (/) and backward slashes (\)
  • Colon ( : ) and semi-colon ( ; )
  • Tilde (~)
  • Punctuation marks, including commas, periods, question marks, and exclamation marks

—Jessie Groll