tags:

views:

52

answers:

3

does the filename in src attribute of an img tag has a limit in number of characters? or compatibility issue among operating system(OS) browsers...

for example:

<img src="../img/misc/this-is-a-very-long-image-filename-of-an-image-named-leaders-systems02.gif" alt="Leaders Systems" class="emblem" />

is there no issue on this-is-a-very-long-image-filename-of-an-image-named-leaders-systems02.gif in all OS browsers??

+1  A: 

I doubt there's an issue with long src attributes in any common browser. However, if you have lots of very long src attributes, it might affect the load time negatively.

icktoofay
+3  A: 

You will be bounded by the maximum URL length per browser. The HTTP server may also send you an HTTP 414 "Request URI too long". The standard does not dictate what this size is, but allows a server to make such a response.

From the HTTP/1.1 standard S10.4.15:

10.4.15 414 Request-URI Too Long

The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a URI "black hole" of redirection (e.g., a redirected URI prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit security holes present in some servers using fixed-length buffers for reading or manipulating the Request-URI.

Brian R. Bondy
+2  A: 

The full url to the asset can not exceed 2048 characters. See HTTP URI GET limit

Ben Rowe