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

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -