mime - How to specify multipart HTML code so it's downloaded with 1 GET request -
i want render web page using content type multipart, sniffer logs show multiple requests images on web page.
here test code:
<!doctype html> <html> <head> <title>multipart/form-data</title> <header><h2>testing multipart/form-data</h2></header> <meta http-equiv="content-type" content="multipart/related; charset=iso-8859-1"/> </head> <body> text outside <form> tag. <form enctype="multipart/form-data" method="post" action="/php/showpostget.php" > <!-- enctype attribute can used if method="post". --> text inside <form> tag.<br /> <input type="submit" value='test'/><br> <form enctype="multipart/text/plain"> name1: <input type="text" name="fname" value="abc"><br> name2: <input type="text" name="lname" value="123"><br> </form> <br /> <img src="/images/arrow_left.jpg" alt="left"> <img src="/images/arrow_right.jpg" alt="right"> <img src="/images/arrow_up.jpg" alt="up"> <img src="/images/arrow_down.jpg" alt="down"> <br/> </form> </body> <br/> </html>
when refresh on web page, expect see single request, see multiple requests (one main page , 1 ea image file). this:
7 10.738337 163.64.287.173 10.235.5.146 http /mdg/html/fileupload/andy/multipart-form-data.html http/1.1 9 10.739553 10.235.5.146 163.64.287.173 http http/1.1 200 ok (text/html) content-type: text/html; charset=iso-8859-1\r\n <meta http-equiv="content-type" content="multipart/form-data; charset=iso-8859-1"/> 17 12.945487 163.64.287.173 10.225.57.136 http /images/arrow_left.jpg http/1.1 19 12.946704 10.225.57.136 163.64.287.173 http http/1.1 200 ok (jpeg jfif image) content-type: image/jpeg\r\n 28 14.816313 163.64.287.173 10.225.57.136 http /images/arrow_right.jpg http/1.1 30 14.817529 10.225.57.136 163.64.287.173 http http/1.1 200 ok (jpeg jfif image) content-type: image/jpeg\r\n 41 17.196125 163.64.287.173 10.225.57.136 http /images/arrow_up.jpg http/1.1 43 17.197342 10.235.5.146 163.64.287.173 http http/1.1 200 ok (jpeg jfif image) content-type: image/jpeg\r\n 51 19.060141 163.64.287.173 10.225.57.136 http /images/arrow_down.jpg http/1.1 53 19.061358 10.225.57.136 163.64.287.173 http http/1.1 200 ok (jpeg jfif image) content-type: image/jpeg\r\n
i expected see 1 request followed several ok/continuation messages (with 'boundary=' data). (from web site):
901 15:36:40.100491 10.277.7.10 72.253.197.19 http /app/wt/default.aspx?vtbl=1&debugds=320&vzmw3=vzmw3 http/1.1
903 15:36:40.317813 72.253.197.19 10.277.7.10 http http/1.1 200 ok content-type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n content-type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n mime multipart media encapsulation, type: multipart/mixed, boundary: "next.part.8412f441-e4ea-4554-8400-9a003df2f78f" first boundary: --next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n content-type: text/html; charset=utf-8\r\n 905 15:36:40.319315 63.64.187.229 97.253.137.46 http http/1.1 200 ok content-type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n content-type: multipart/mixed; boundary=next.part.8412f441-e4ea-4554-8400-9a003df2f78f\r\n 906 15:36:40.320116 72.253.197.19 10.247.7.10 http continuation
you won't able in html. content-type: multipart/...
http header, whereas html tag <meta http-equiv="content-type">
supports limited values defined here: http://www.w3.org/tr/html-markup/meta.http-equiv.content-type.html#meta.http-equiv.content-type
a specially formatted string providing character encoding name. value: following parts, in following order:
- the literal string "
text/html;
".- optionally, 1 or more space characters.
- the literal string "
charset=
".- one of following:
- for documents in html syntax: character encoding name.
- for documents in xml syntax: case-insensitive match string "
utf-8
".
in other words, since html document, allowed content-type "text/html".
you want specify "multipart/mixed" in http headers on server side (e.g. using php header() or similar). then, looks browsers support are/were firefox/netscape; see how download multiple files 1 http request?
Comments
Post a Comment