开发者

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

开发者 https://www.devze.com 2023-01-07 11:03 出处:网络
The characters I have come across that will break an image in a HTML page if used in the image’s filename are:

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

精彩评论

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