开发者

What are all of the characters that will break an <img> tag if used in its filename

The characters I have come across that will break an image in a HTML page if used in the image’s filename are:

& / \ *

Are there any other filename characters that would cause an image to not display?

The reason I’m asking is I need to store an image of some text and need to replace invalid characters in the filename.

This mechanism is in place, just trying to find a quick list of characters to save the tes开发者_C百科ter some time.


First off, this is little to do with HTML and a lot to do with the OS your sever is running on.

It looks like Windows here, so the characters for that are

\ / : * ? < > |

The & however, is likely a property of HTML. You can probably still use them in your files, but for the HTML, put &amp; instead of &. If you don't want to do this, you can always disallow &s in the files as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜