Created
November 18, 2016 16:12
-
-
Save kbshl/f2b5305ff08e0621295018910f534f87 to your computer and use it in GitHub Desktop.
The right and wrong way to save file paths in Titanium Mobile - From http://skypanther.com/2015/08/the-right-and-wrong-way-to-save-file-paths-in-titanium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// right way: | |
var file = Titanium.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filename); | |
file.write(imageBlobData); | |
// save only the file's name | |
myModel.set('filepath', filename); | |
myModel.save(); | |
// then this will work even after an upgrade | |
myImageView.image = Ti.Filesystem.applicationDataDirectory + myModel.get('filepath'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment