IDE xcode 7.1 App target iOS 8/9
As I've described in the title, system doesn't allow read/write files by local path fetched from PHAsset. but somehow it allows to create a new Instance of NSData by the local file url. NSDATA can be used for uploading. but app runs out of memory if the file(video, image) is large size
Please note this issue can be reproduced only on a device.
Fetch local file(image/video) path(NSURL) from PHAsset.
and upload using the method
It will fail with errors as follows
<Warning>: my_log: The operation couldn’t be completed. File URL not reachable.
deny(1) file-read-metadata /private/var/mobile/Media/DCIM/100APPLE/IMG_0008.MOV
15:41:25 iPhone-6s kernel <Notice>: Sandbox: My_App(396) deny(1) file-read-metadata /private/var/mobile/Media/DCIM/100APPLE/IMG_0008.MOV
15:41:25 iPhone-6s My_App <Warning>: The file “IMG_0008.MOV” couldn’t be opened because you don’t have permission to view it.
Since user grants permission to app to access photos and videos that error doesn't make any sense.
I've posted this issue on stackoverflow:
And no solution found so far.