This is a migrated thread and some comments may be shown as answers.

Saving Images to device and append

3 Answers 107 Views
AppBuilder Windows client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Keen
Top achievements
Rank 1
Keen asked on 18 Jun 2013, 10:06 AM
Hi guys

     Hi does anyone know how to save images that I get from a site and get the image to specific div? Im using jquery mobile not kendo..im targeting iOs device.

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 Jun 2013, 12:16 PM
Hi Keen,

You can save an image from a URL via the Cordova File API's Filterable object (see here). A small sample for downloading an image using FileTransfer can be cloned and tested from here.

About displaying it in a div, you might consider using the .prepend() method e.g.:

$('#theDiv').prepend('<img id="img" src="<path_to_image>" />')

Regards,
Steve
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Missed our first webinar, watch it here.
Share feedback and vote for features on our Feedback Portal.
0
Keen
Top achievements
Rank 1
answered on 19 Jun 2013, 05:17 AM
Hi Steve,

     Currently its working on device not on simulator. but anyways I just want to ask if its possible to specifically put a path? like it will go to photos. I'm using iPad, and if its not possible how to delete downloaded photos?
0
Steve
Telerik team
answered on 19 Jun 2013, 12:04 PM
Hello Keen,

Yes the File API is not yet supported in the Simulator and the sample would only work on a device.
About your question - the download method of FileTransfer has a target/filePath parameter which allows you to specify the exact full path, refer to Cordova FileTransfer API for more information.

Regards,
Steve
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Missed our first webinar, watch it here.
Share feedback and vote for features on our Feedback Portal.
Tags
AppBuilder Windows client
Asked by
Keen
Top achievements
Rank 1
Answers by
Steve
Telerik team
Keen
Top achievements
Rank 1
Share this question
or