This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How can I refer to a filename with a # in it (e.g. A#.png)? Note: "./A#.png" doesn't work.

  • 3 respostas
  • 3 have this problem
  • 2 views
  • Last reply by cor-el

more options

Is there a way to get Firefox to load a file when the file name includes the character "#".

I use #'s in filename's to represent musical key signatures, and want to continue to do so.

I've tried using "& # 35 ;" (without the intervening spaces) in place of the #'s but this doesn't work.

Neither of the following file references work with FireFox (both work with IE) ...

   ... src="./A& # 35 ;.png" ...       <=  (without the intervening spaces)

   ... src="./A#.png" ...
Is there a way to get Firefox to load a file when the file name includes the character "#". I use #'s in filename's to represent musical key signatures, and want to continue to do so. I've tried using "& # 35 ;" (without the intervening spaces) in place of the #'s but this doesn't work. Neither of the following file references work with FireFox (both work with IE) ... ... src="./A& # 35 ;.png" ... <= (without the intervening spaces) ... src="./A#.png" ...

JimBayne modificouno o

Chosen solution

The hash (#) is used to specify an anchor name or id in the file.
You need to escape such characters if they are part of the name: A%23.png

javascript:var p='%s';do;while(p=prompt(escape(p),p));
Ler a resposta no contexto 👍 1

All Replies (3)

more options

Chosen Solution

The hash (#) is used to specify an anchor name or id in the file.
You need to escape such characters if they are part of the name: A%23.png

javascript:var p='%s';do;while(p=prompt(escape(p),p));
more options

Many thanks cor-el! That works perfectly.

more options

You're welcome.

You may also need to use encodeURIComponent in some cases:

javascript:var p='%s';do;while(p=prompt(encodeURIComponent(p),p));

cor-el modificouno o