ios - How to determine what's the file type -


i use asihttprequest download file. url http://www.aaa.bbb.com:8000/showuploaddocument.aspx?docid=45. not able determine file type through url. how can determine file type of downloaded file?

you can query content-type header returned server:

nsstring *contenttype = [[request responseheaders] objectforkey:@"content-type"]; 

this string image/jpeg, text/plain, etc.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -