External Storage Plugin

This plugin allows you control manage file outside the app sandbox and into the phone

Limitations:

Only works Android and only handles external storage

Functions:

externalStorage.getFile(pathExternal, pathCorona,shouldLookAtRoot)-- returns one of the following strings "could not find file", "could not save file", or "file saved". shouldLookAtRoot = should we look at base of device (default is false, true recommended for sd card

tranfer file to corona

pathExternal(string)-- where to get the file example "/test.txt"

pathCorona(path)-- where to export the file to, note system.pathForFile

externalStorage.copyFile(pathCorona, pathExternal, shouldLookAtRoot)-- returns one of the following strings "could not find file", "could not save file", or "file saved". shouldLookAtRoot = should we look at base of device (default is false, true recommended for sd card

tranfer file to external file

pathCorona(path)-- where to export the file to, note system.pathForFile

pathExternal(string)-- where to export the file to example "/folder1/test.txt"

externalStorage.deleteFile(pathExternal, shouldLookAtRoot)-- returns boolean true if deleted, false if not. shouldLookAtRoot = should we look at base of device (default is false, true recommended for sd card )

delete file in external storage

pathExternal(string)-- where to delete the file example "/test123.txt"

externalStorage.listFiles(pathExternal, shouldLookAtRoot)-- returns array of file paths, shouldLookAtRoot = should we look at base of device (default is false, true recommended for sd card )

list files in external storage

pathExternal(string)-- where to list the files example "/Music"

externalStorage.doesFileExist(pathExternal, shouldLookAtRoot)-- returns boolean true if file exists, false if not, shouldLookAtRoot = should we look at base of device (default is false, true recommended for sd card )

does file exist in external storage

pathExternal(string)-- where to check if file exists example "/dir/myFile.pdf"

externalStorage.makeFolder(pathExternal, shouldLookAtRoot)--

pathExternal(string)-- where to put the file and what to call the file "/newFolder"

externalStorage.isSdCardConnected()-- returns boolean, true if connected , false if not

externalStorage.sdCardPath()-- returns path of sd card to be used to copy, delete, get and list files with apis above

externalStorage.isSdCardWriteable()-- can you write to sd card (there may be restritions), returns boolean

externalStorage.totalSpace()-- returns mb(number) of data on phone

externalStorage.spaceAvailable()-- returns mb(number) of data free on phone

externalStorage.getExternalFilesDir(type)-- returns the absolute path to the directory on the primary shared/external storage device.

type(string) The type of files directory to return.

externalStorage.rename(pathExternal, newName,shouldLookAtRoot)

pathExternal(string)-- where is the file to rename

newName(string)-- what to name the new file

shouldLookAtRoot(boolean)(optional) if true, it will look at root

Properties:

the following return string that can be used in copy, delete, get and list files with apis above

  • externalStorage.dcim
  • externalStorage.download
  • externalStorage.movies
  • externalStorage.ringtones
  • externalStorage.podcasts
  • externalStorage.music

Build.settings

Helpful Links:

Get Plugin

Example

Support