Objective-C: Get size of a PDF that loads inside a webpage from NSURLResponse
How can i get the size of a pdf that loads inside a webpage? Usually I use the headers from the NSURLResponse to distinguish the size, but in this case I dont know how to do. The header i get looks like:
response headers: {
"Cache-Control" = "max-age=3600, private, must-revalidate";
"C开发者_StackOverflow社区ontent-Disposition" = "inline; filename=000164702760379530.pdf";
"Content-Type" = "application/pdf; charset=UTF-8";
Date = "Sun, 16 Jan 2011 14:47:45 GMT";
Pragma = "";
Server = "AtyponWS/7.1";
"Transfer-Encoding" = Identity;
"X-Webstats-Respid" = b0324d930da3307597086eafb0e149c5;
Does anyone know how to get the size of the whole page including the pdf or just the pdf?
See this: How to determine the size (in bytes) of a file downloading using NSURLConnection?
You can use the NSURLResponse method
[httpResponse expectedContentLength];
精彩评论