Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simple question on html img tag

Tags:

html

image

tags

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??

like image 773
Reigel Avatar asked Jun 24 '10 04:06

Reigel


2 Answers

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.

like image 117
Brian R. Bondy Avatar answered Sep 25 '22 06:09

Brian R. Bondy


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

like image 39
Ben Rowe Avatar answered Sep 25 '22 06:09

Ben Rowe