Created
September 30, 2011 15:13
-
-
Save tonylukasavage/1254047 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var appFilePath = Ti.Filesystem.resourcesDirectory + 'w4.pdf'; | |
var appFile = Ti.Filesystem.getFile(appFilePath); | |
var tmpFile = undefined, | |
newPath = undefined; | |
if (Ti.Filesystem.isExternalStoragePresent()) { | |
tmpFile = Ti.Filesystem.createTempFile(); | |
newPath = tmpFile.nativePath + '.pdf'; | |
tmpFile.move(newPath); | |
tmpFile = Ti.Filesystem.getFile(newPath); | |
tmpFile.write(appFile.read()); | |
} else { | |
Ti.API.error('No external storage present'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment