Page 3 of 4

Image from file system

Posted: Tue Dec 17, 2013 11:14 am
by Maryna Brodina

Sorry, I can't login with provided credentials. There is an error in console - Login with wrong password. Sign up and Login with Facebook don't work as well... Could you check if you've posted correct login/password?


Image from file system

Posted: Tue Dec 17, 2013 6:33 pm
by Mehmet Edebali Şener

can you try again with un=appery pass=12341234


Image from file system

Posted: Tue Dec 17, 2013 9:15 pm
by Kateryna Grynko

Hi Mehmet,

Try the following please:

1) Add this line before calling RequestFileSystem prewindow.RequestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;/pre2) Instead of LocalFileSystem.PERSISTENT use PERSISTENT.


Image from file system

Posted: Tue Dec 17, 2013 11:06 pm
by Mehmet Edebali Şener

Hi thanks again,
I changed the code like this:

precode
function fail(evt) {
alert(evt);
}
var fileUrl = 'https://api.appery.io/rest/1/db/files/' + deneme_settings['database_id'] +"/"+value + "?sessionToken=" + localStorage.getItem('sessionTokenId');
window.RequestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.RequestFileSystem(
/LocalFileSystem./PERSISTENT, 0,
function onFileSystemSuccess(fileSystem) {
fileSystem.root.getFile(
"SureTerms/"+value, {create: false, exclusive: false},
function fileExist(fileEntry){
$("[dsid=pimage]", element.parent()).attr("src", fileEntry.toURL());

Code: Select all

         },  
         function fileDoesNotExist(){ 
             window.RequestFileSystem( 
                 /*LocalFileSystem.*/PERSISTENT, 0,  
                 function onFileSystemSuccess(fileSystem) { 
                     fileSystem.root.getFile( 
                         "dummy.html", {create: true, exclusive: false},  
                         function gotFileEntry(fileEntry){ 
                             var sPath = fileEntry.fullPath.replace("dummy.html",""); 
                             var fileTransfer = new FileTransfer(); 
                             fileEntry.remove(); 

                             fileTransfer.download( 
                                 fileUrl, 
                                 sPath + "SureTerms/"+value, 
                                 function(theFile) { 
                                     alert("download complete: " + theFile.toURL()); 
                                     alert(fileEntry.fullPath); 
                                     $('[dsid=pimage]', element.parent()).attr('src', theFile.toURI());  
                                 }, 
                                 function(error) { 
                                     alert("download error source " + error.source); 
                                     aler("download error target " + error.target); 
                                     alert("upload error code: " + error.code); 
                                 } 
                             ); 
                         },  
                         fail); 
                 },  
                 fail); 
             //fileDoesNotExist 
         }); 
 },  
 fail); 

/code/pre

and it's not working either.It alerts "File Error.QUOTA_EXCEEDED_ERR" on chrome via desktop. In Safari via desktop and Android device it does not give any alert and not working too.


Image from file system

Posted: Wed Dec 18, 2013 10:35 am
by Maryna Brodina

Hello!
1) You receive preFile Error.QUOTA_EXCEEDED_ERR/prebut you request prewindow.RequestFileSystem(/LocalFileSystem./PERSISTENT, 0,.../pre try to request 10 MB for example prewindow.RequestFileSystem(/LocalFileSystem./PERSISTENT, 1010241024,.../pre
2) Are you sure this functionaliry is supported where yo test it? Check here https://developer.mozilla.org/en-US/d...


Image from file system

Posted: Wed Dec 18, 2013 10:31 pm
by Mehmet Edebali Şener

I have tried 10MB too and not worked on android.

Funcinality supported according to phonegap.

http://docs.phonegap.com/en/3.3.0/cor...

Still, I am gonna try to change it. thanks for help.


Image from file system

Posted: Thu Dec 19, 2013 6:43 am
by Maryna Brodina

Let us know if you need help.


Image from file system

Posted: Sun Dec 22, 2013 9:10 pm
by Mehmet Edebali Şener

Hi still not working and i am sure this functionality supported on android.

Because it downloads image to the phone. The problem is about showing files.

As i said before after assigning source if i alert the source it gives some png data as hexa decimal. However it doesn't show in application.

İs there any example code for showing images from local file system of phone in appery? I know appery includes phonegap and things which works on phonegap has to be works on appery but any of the phonegap examples which i tried not working either.


Image from file system

Posted: Tue Dec 24, 2013 7:59 am
by Kateryna Grynko

Hi Mehmet,

Please post an example of the image code you get. If it is coded as base64 you can use this approach then:prevar base64 = "url(data:image/png;base64," + yourCode+ ")";
Appery("mobileimage").css("background-image", base64);

Appery("mobileimage").attr("src","");/preWhere 'mobileimage' is an Image component name,
'yourCode' is your image code.


Image from file system

Posted: Mon Jan 06, 2014 3:01 am
by Mehmet Edebali Şener

Hi, any of these don't solve the problem. Just please can you give me a simple example code for reading any png file named "a.png" from local file storage on android device and showing it in image component.