Type Function Library media.* Return value none Revision Release 2024.3703 Keywords media, photo library
Adds specified file to photo library.
On the Corona Simulator, the files are not added to the actual user’s photo library. On Mac, it is saved to the location specified in the Corona Simulator Console output.
On Android, you must add the android.permission.WRITE_EXTERNAL_STORAGE
permission to your project’s build.settings
file. Otherwise, Android will not allow your photo to be added to the photo library:
settings = { android = { usesPermissions = { "android.permission.WRITE_EXTERNAL_STORAGE", }, }, }
media.save( filename [, baseDir] )
String. The name of the image file to be added to the photo library, relative to baseDirectory
(or system.ResourceDirectory
by default).
Constant. Path to load the image data from filename. Default is system.ResourceDirectory
. See system.pathForFile() for valid values).
media.save( "world.jpg", system.TemporaryDirectory )