Hi everyone, I am getting a .png file from server . I've downloaded it as given in docs . But i when i set it to imageView , it becomes white. I traced the native path of downloaded image , image is there but when i open it , it gives error . When i save this file without png extension , it shows that it is a doc file and consists the path of image on server. here's my code
//here i am uploading my image var file = Ti.Filesystem.createTempFile(myProfile.fn.value+'.png'); file.write(myProfile.contactImg.image); var filepath = file.nativePath; updateMyProfile.getCon(Ti.App.Properties.getString('loginUserId'), Ti.App.Properties.getString('loginId'), Ti.App.Properties.getString('loginPWD'), myProfile.fn.value, myProfile.addTxt.value, file); Ti.App.Properties.setString('Profilepic', filepath);here i am downloading image and setting it on imageView
var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, y.result.Username +'.png'); f.write(y.result.Profilepic); // write to the file var filepath = f.nativePath; Ti.App.Properties.setString('Profilepic', filepath); Ti.API.info('profile pic == ' + y.result.Profilepic); Ti.API.info('profile downloaded pic == ' + filepath);i am setting image using the filepath.