Reputation: 1897
I have NSData
received from server for which i don't know the MIME
type.
Now i want to convert the NSData into any file like Image/Pdf without knowing the MIME/extension of that file and i want to open that file in iPad.
So i want to convert my NSData
into a file with default MIME
type and should open it.
So is there any option like open with...
Any suggestion or sample would be appreciated.
Thanks in advance..
Upvotes: 0
Views: 995
Reputation: 104698
NSData
is just raw data.
So you have two primary options:
%PDF
.If you are working with a small set of formats, you could likely determine the type of data based on the contents of the data. So you might see some APIs which are able to figure out the type the data represents when it has a handful of supported formats which it can identify… but to determine any data would take a long time to process, and to implement. It would also have a fairly high failure rate, due to all the data types/formats available -- published and unpublished, and data formats which don't necessarily have data sequences which identify them uniquely.
Upvotes: 1