Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Saving images from webview

Hi, I'm trying to save images which are loaded and rendered in a webview. The way I get this done is by gathering all urls of the images in the webview javascript context and send them as a list to an event listener attached on Ti.App. Then I load them one by one (again..) with a XHR object to get them written to files (responseData) on the device…. my question is, can this be done easier? Maybe there is some cache or temp place where I could retrieve the images from?

— asked March 9th 2010 by Alexander van der Werff
  • file
  • image
  • save
  • webview
0 Comments

3 Answers

  • In the current implementation, only custom events can pass back and forth between web views, so you couldn't directly write those files. It might be worth backing up a bit to see if there's a way your native code could simply go out and fetch those images. Maybe you could do an XHR request for the page's HTML and parse that in native code?

    — answered March 9th 2010 by Kevin Whinnery
    permalink
    0 Comments
  • true, but the images should be available in some sort of cache folder…. but I guess pre parsing is my best option

    — answered March 9th 2010 by Alexander van der Werff
    permalink
    0 Comments
  • true, but the images should be available in some sort of cache folder…. but I guess pre parsing is my best option

    — answered March 9th 2010 by Alexander van der Werff
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.