Path of photos folder in ipad - ios

I am trying to make a ipad app which would upload the latest synced photos on an ipad to a web server.
I found a great reference for how to upload a file by http here.
How can I upload a photo to a server with the iPhone?
However what should be the path to the photos folder?
It would be great if somebody can suggest an example for
Listing all directory in the photos application.
How to enumerate a file in a directory/album and get its path.
I am really new to iOS devleopment. Sorry if i am bit vague.

Appears to be in /var/mobile/Media/DCIM/ .
Reference: http://www.macstories.net/ipad/ipad-photos-documents-finder-mac/

Refer - How can I load images from a user's photo album on the iPhone?

Related

Get path of a PHAsset coming from CameraRoll iOS with react native

I'm building a video app uploader using react-native.
I encounter a problem with file management from cameraroll. I have video inside my camera roll that i want to either play in my app (using rn-video), or upload them.
I tried using react-native-image-crop-picker with Passtrough option that should not compress video, but i feel like it's copying the video from cameraroll of iOS to AppData. So for big video i'm stuck sometime a longtime on "Processing Asset ..." window (see post here).
Now my question is, using react-native-cameraroll, i can fetch directly information about local video, but what i get is a link like this : ph://EA9508C5-6B69-46EC-8980-832774283946/L0/00
Is there a way to transform this link into something like this : 'file:///sdcard/Movies/sintel.mp4' without copying the video entirely into my appData (to avoid long import)
Thanks in advance
After some research, i found that we can use a different path called assets-library in iOS :
assets-library://asset/asset.${'mov'}?id=${appleId}&ext=${'mov'}
If you use this path with appleId being the ph asset identificator (something that look like this : const appleId = 'EFA45A33-818E-4A67-A0D8-50991A9B89FB/L0/001' it will work perfectly.
It will work with react-native-fs //File system for RN for copy/paste video for example

How to copy photo in device's photo gallery to local path

I have found lots of answers regarding how to download and save online photos to the app's cache or temporary directory. However, I need to know how to copy an image from the device's local gallery to the app's cache.
The reason for this is a strange problem with iOS, where attempting to upload images to Firebase, using paths of images in the gallery, always fails in a physical device and always works in iOS simulator and Android (both physical and simulated). In the app I am building I also have the ability to take photos, which are saved to the app's directories by the camera app, and those uploads work fine. I need to try and first copy the images to my cache, to test if it will allow me to upload them to firebase successfully. I am using multi_image_picker to get the local paths of the selected images from the gallery, all I need is to know, once I have those paths, how to copy a single one of those files to my app's temp directory (I use path_provider to get the appropriate path to temp directory).
It probably isn't a permissions issue because I have both Camera and Photo Library permissions in my plist.info, I get prompted for access and I can access the gallery without a problem when using the multi picker.
I have tried looking at the camera plugin's files and figure out how it does it, but no luck, I get lost once the plugin calls native methods.
I appreciate any help.

Adobe AIR : get user's video content on iOS

I have to develop an AIR app for a client, that reads the video folder content and can play any video in it.
It's quite easy with Android, I can read any folder on the phone/tablet, but on iOS it's not that easy. I can't use applicationDirectory because the client wants to put videos himself later in the videos folder on iPad. (But if you have a solution to put files in applicationDirectory with iTunes or else, please share !)
I know there are some ane's that read the cameraroll content, but they display a native pickup screen, while I just need a list of the files.
I tried to use File.documentsDirectory to access content, but got no luck. If you have any idea, thanks in advance !
Ok I found a workaround : in my XML application file I added <key>UIFileSharingEnabled</key><true/> to the iPhone infoAdditions, so that I can access to app's documents through iTunes. I add files with iTunes, and I can read the content of the folder in AIR with File.documentsDirectory.getDirectoryListing()
Hope it will help someone else !

How to pick(picker view) any files from ios device using objective c?

I was developing an ios application for file backup. In that I need to list and enable user to pick up files from any folder and need to do email backup like media and image picker.
I am struckup here with a bottle neck. I can't triger populating the list of document and email list for the user to pick. I had tried many codes, but it is not working.
I was working with the simulator.
Could anyone share their insight?
Regards
You should be more precise : do you want to pick up any file from any application on your device or just in your application library folder ? You can't access others applications folders.
You can find more information about the file system here :
https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html
iPhone do not have a file browser.
The only place that a iPhone app can take file is from photo album.
Every application keeps its files in its private place.

ios using itunes to upload an image to app

how can I have itunes uploading an image to the directory of my app on iOS
like user selects an png from her computer and upload that image to the file system sandbox of the app
thanks!
The feature you're looking for is called 'iTunes File Sharing'. With some googling you will be able to find plenty of tutorials about this, such as: http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app

Resources