Are spaces allowed in image names? | Community
Skip to main content
Level 3
June 23, 2015
Question

Are spaces allowed in image names?

  • June 23, 2015
  • 2 replies
  • 10349 views

I just noticed that all the images for our email template headers were uploaded with spaces in the file name. I thought I had learned that you could not have spaces in the file names in Marketo because it would break the link for the image.

However, I can't find any information on that now. Also, when I send a sample email, the header shows up just fine.

Any help is appreciated!

Thanks!

2 replies

Scott_McKeighe2
Level 4
June 23, 2015

While I don't think it's explicitly forbidden, spaces in naming conventions are notoriously unreliable. If I were in your shoes, I would add simple hyphens in place of those spaces ("my-file-name.xxx") so as not to accidentally discover a problem later with a URL being mutated or broken.

All that said, it's also reasonable to stick with, "if it ain't broke, don't fix it."

Josh_Hill13
Level 10
June 23, 2015

Totally agree. Never, ever upload a file to marketo (or web) with spaces. Marketo is not reliably putting %20 in the space. Your URL will break and the lead will think you are a bad company.

Always use dashes in filename before you even upload it.

Bonnie_Jeffers2
Level 3
June 28, 2016

Hi Josh, I totally agree with you and (wrongly) assumed our practitioners would know this about urls in general, but they don't. Do you have a not-so-technical way to explain why it's important to only upload files with hypens/underscores rather than spaces?

Here is what I tell my users when they can't understand why something is broken and due to spaces in their file names, but I'm wondering if there's a clearer way to say it.

"The space character is not allowed in URLs. Marketo will create one for you, but HTML cannot parse the space character.  So when someone clicks a link that contains a space, HTML replaces every space with %20.

So if you are trying to triggering an action based on:

Clicks Link go.epicor.com/rs/ABC-123/images/My File Has Spaces.pdf

what you really would want to track is:

Clicks Link go.epicor.com/rs/ABC-123/images/My%20File%20Has%20Spaces.pdf

but don't do that either. Best practice is to upload your files with hypens or underscores such as:

go.epicor.com/rs/ABC-123/images/My-File-Has-Spaces.pdf or go.epicor.com/rs/ABC-123/images/My_File_Has_Spaces.pdf

Thanks for any thoughts on this.

Srujan_Vishwana
Level 4
June 23, 2015

The best practice which has worked for me is following this naming convention: My_image_name_abc_xyz

This will not only avoid the spaces but will also hide the underscore giving it a look of not having space and still there is no link breakage. Hope this helps.

Cheers,

Sru