Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get camera roll file location in iphone using phonegap?(For creating a custom camera roll from which multiple files can be chosen)
    primarykey
    data
    text
    <p>I am working on iPhone app using PhoneGap. </p> <p>In this app I need to show a screen with camera roll pictures and the user should be able to select multiple photos from it.</p> <p>Using <code>navigator.camera.getPicture</code> I can show all images, but user can select only one image from it.</p> <p>The imageURI returned is <code>file://localhost/var/mobile/Applications/946FDEC2-E166-4209-94F8-5E2C70EEDA71/tmp/cdv_photo_010.jpg</code></p> <p>And tried with file api as below.</p> <pre><code>window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){ // success get file system var sdcard = fileSystem.root; sdcard.getDirectory("../../../Media/DCIM/100APPLE", {create:false, exclusive: false}, function(dcim){ var directoryReader = dcim.createReader(); directoryReader.readEntries(function(entries){ // success get files and folders for(var i=0; i&lt;entries.length; ++i){ alert(entries[i].name); } }); }, function(error){ switch(error.code){ case FileError.NOT_FOUND_ERR : alert('NOT_FOUND_ERR');break; case FileError.SECURITY_ERR: alert('SECURITY_ERR');break; case FileError.ABORT_ERR: alert('ABORT_ERR');break; case FileError.NOT_READABLE_ERR: alert('NOT_READABLE_ERR');break; case FileError.ENCODING_ERR: alert('ENCODING_ERR');break; case FileError.NO_MODIFICATION_ALLOWED_ERR: alert('NO_MODIFICATION_ALLOWED_ERR');break; case FileError.INVALID_STATE_ERR: alert('INVALID_STATE_ERR');break; case FileError.SYNTAX_ERR: alert('SYNTAX_ERR');break; case FileError.INVALID_MODIFICATION_ERR: alert('INVALID_MODIFICATION_ERR');break; case FileError.QUOTA_EXCEEDED_ERR: alert('QUOTA_EXCEEDED_ERR');break; case FileError.TYPE_MISMATCH_ERR: alert('TYPE_MISMATCH_ERR');break; case FileError.PATH_EXISTS_ERR: alert('NOT_FOUND_ERR');break; } }); </code></pre> <p>This works in simulator. </p> <p>But when tried in iPhone it shows error and there is no <code>DCIM</code> folder inside <code>../../../Media</code> in the iPhone.</p> <p>My iPhone model is <code>iPhone 4S 16Gb with iOS 6.0</code></p> <p>I would like to know</p> <ol> <li>Is there anything wrong with this approach?</li> <li>What is the correct path instead of <code>../../../Media/DCIM/100APPLE</code> in which the camera roll pictures are saved?</li> <li>Is there any meta files in which the above mentioned path is stored?</li> <li>Is there any other method to achieve this (option to select multiple files from camera roll) ?</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload