PhoneGap / Cordova: Upload only new images with camera

188 views Asked by At

I am building an application that will require the user to take a photo and upload it to the server. The user may not access their camera roll and the photo must not save to the camera roll.

I cannot find any documentation on this. Is it possible?

2

There are 2 answers

0
AudioBubble On BEST ANSWER

Sorry, I was not clear on this. You CANNOT HIDE the [camera roll | gallery].

However, on iOS the image/photograph is placed in a temporary directory and only the App has access to it; the camera roll does not have access to it. And since the file is in a temporary directory, it will be deleted the next time the phone is restarted (turned on and off).

On Android, ALL IMAGES are visible, regardless of where they are stored. The best strategy is to delete it ASAP.

Also, the Phonegap API has a camera.cleanup which the documentation says:

Removes intermediate photos taken by the camera from temporary storage.

HOWEVER, in both circumstances it would be best to delete the image as soon as possible. To comply with HIPAA immediately make the image base64 (which is text) and delete the image. Now you have a TEXT-base image that can be translate back to binary, and you can upload the image at your leisure.

Beyond that, meeting the actual HIPAA requirements is a matter of knowing the HIPAA procedure. And on that, it is beyond the scope of the forum, but feel free to contact me off-line about HIPAA.

1
AudioBubble On

@visevo, you can use my demo to start your project. It will give you a jump-start, but you will eventually have to build your own App. You will understand once you get to your goals. Go to my phonegap demos, I use Phonegap Build and the core Phonegap plugins. There are more plugins, if the core plugin does not work for you (see documentation.)

From my demos, you want Phonegap-Camera-Test. It uses the Phonegap core Camera plugin. With the plugin, you can define the images, how it is taken, and how the image is returned to you, but you canNOT define how or where it is stored. The program works with Android and iOS.

For documentation, the offical documentation is confusing. I have notes you can read.

Android does NOT have a Camera roll. It is called Gallery. The Gallery is able to see ALL the images (photos, icon, drawings, movies) on the device. There is no way to hide the images under Android. You will have to delete the image after you have uploaded it.

The Camera on iOS does NOT save to the Camera roll. It saves the photo to a temporary location. After the picture is taken, you can get a handle to the photo, and them upload it. The photo cannot be seen by the Camera roll.

To upload the photos, you will have to use the FileTransfer Plugin. (See documentation)

Any questions?