The code works for me, saving the captured image to a file in to app.path directory.