Build 724 HELP! - Can't save image to directory as described in the build text

Can someone give an example of how this works? My code is below and I’m not getting the file to write to the system.DocumentsDirectory - THANKS!

My Code:

local options =
{
file = { baseDir=system.DocumentsDirectory, filename=“currentphoto,jpg” },
}

local takePhotoButton = display.newImageRect( “buttons/orangeCamera.png”, 100, 100 )
function takePhotoButton:tap( event )
media.show( media.Camera, onComplete, options )
end
takePhotoButton:addEventListener( “tap”, takePhotoButton )
I’m relying on this daily build info:
CoronaSDK 2012.724
Post date: Wed, 2012-01-11 04:50

Release notes for build 2012.723 through 2012.724

iOS: adds ability to save photos from camera/photo picker to disk in media.show( source, listener [, file] ). The ‘file’ parameter is an optional table, similar to how file attachments are specified for e-mail in native.showPopup, e.g. {baseDir=, filename=}. If the ‘file’ parameter is present, there will *not* be a display object created.

Core: fixes bug in table file path conversion

Android: Modified media.show() to allow you to write the selected image to a path\file of your choosing at full resolution instead of displaying it onscreen.

Core: Added boolean property “event.completed” to media.show() event. Set true if an image was successfully selected. Set false if user canceled out, if an error occurred, or the platform does not have the request media source such as a camera.

Cases affected:
[import]uid: 15571 topic_id: 21415 reply_id: 321415[/import]

If this is in your code too it wont work …

[code]
local options =
{
file = { baseDir=system.DocumentsDirectory, filename=“currentphoto,jpg” },
}

–should be
local options =
{
file = { baseDir=system.DocumentsDirectory, filename=“currentphoto.jpg” },
}

–You had a comma in your filename [import]uid: 84637 topic_id: 21415 reply_id: 84820[/import]

Wow, duh! I’ve been a programmer since 1980 and this one still messes me up! Thanks! [import]uid: 15571 topic_id: 21415 reply_id: 84821[/import]

No problem, happens to the best of us :slight_smile: [import]uid: 84637 topic_id: 21415 reply_id: 84823[/import]