SHARE
TWEET

Untitled

a guest Jan 27th, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             window.resolveLocalFileSystemURI imageUri, (fileEntry) =>
  2.  
  3.                 window.requestFileSystem LocalFileSystem.PERSISTENT, 0, (fileSystem) =>
  4.  
  5.                     fileSystem.root.getDirectory "tmp", { create: true, exclusive: false }, (dir) =>
  6.  
  7.                         fileEntry.copyTo dir, imageUri.substr(imageUri.lastIndexOf('/') + 1), (fileEntry) =>
  8.  
  9.                             fileEntry.file (file) =>
  10.  
  11.                                 photo = new Photo()
  12.                                 photo.set "name", file.name
  13.                                 photo.set "fullPath", file.fullPath
  14.                                 photo.set "type", file.type
  15.                                 photo.set "lastModifiedDate", file.lastModifiedDate
  16.                                 photo.set "size", file.size
  17.                                 photo.save()
  18.  
  19.                     -> alert("Can't copy file")
  20.  
  21.                 -> alert("Can't get file system")
  22.  
  23.             -> alert("Can't get file entry")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top