Search code examples
iphonecocoa-touchuiwebviewmobile-safari

Display image blobs directly in UIWebView?


I have a bunch of images stored in my database as blobs that I need to include in a UIWebView. I'd like to do this directly -- without first saving them as temp files. Is there a way to display images in UIWebView with raw data instead of a URL?


Solution

  • Use RFC 2397, the data URI scheme. Mark Kolich has a nice write-up for it in various contexts. He mostly is discussing CSS, but HTML is the same (and he gives an HTML example).