download image, save its fullPath in indexeddb and display it later
download image, save its fullPath in indexeddb and display it later
BY 15 Nov 2013Web Application Development
In the future you will be able to store images directly in the db. Tizen currently does not support this. So I am using tizens download api:
var imageDownloadRequest = new tizen.DownloadRequest(uri, “images/speciesImages”, filename);
downloadId = tizen.download.start(imageDownloadRequest, downloadListener);
oncompleted: function(id, fullPath) { /*add the path to db */ }
:: Completed with id: 1384877701, full path: images/speciesImages/bird.png
If I now use this given fullPath as the following:
<img src=”images/speciesImages/bird.png” />
the image does not display. I can verify that the image is there at it occurs if I browse the emulator via the “My Files” icon. I also tried ‘/images/…’ without success
SOLUTION:
use an intermediate call to tizen.filesystem.resolve to get a fileEntry and the use the toURI method in this entry
tizen.filesystem.resolve(fullPath, function(fileEntry){
var usableURI = fileEntry.toURI() );
/* store this uri in db */
}
download image, save its fullPath in indexeddb and display it later
In the future you will be able to store images directly in the db. Tizen currently does not support this. So I am using tizens download api:
var imageDownloadRequest = new tizen.DownloadRequest(uri, “images/speciesImages”, filename);
downloadId = tizen.download.start(imageDownloadRequest, downloadListener);
oncompleted: function(id, fullPath) { /*add the path to db */ }
:: Completed with id: 1384877701, full path: images/speciesImages/bird.png
If I now use this given fullPath as the following:
<img src=”images/speciesImages/bird.png” />
the image does not display. I can verify that the image is there at it occurs if I browse the emulator via the “My Files” icon. I also tried ‘/images/…’ without success
SOLUTION:
use an intermediate call to tizen.filesystem.resolve to get a fileEntry and the use the toURI method in this entry
tizen.filesystem.resolve(fullPath, function(fileEntry){
var usableURI = fileEntry.toURI() );
/* store this uri in db */
}
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio
BY
30 Oct 2023
Tizen Studio