PHotos Framework: Can't upload Videos/Images by local file path fetched from PHAsset

Environment:


IDE xcode 7.1 App target iOS 8/9

OS 10.11


Short Description:

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.

Steps to Reproduce Issue


Fetch local file(image/video) path(NSURL) from PHAsset.


and upload using the method


- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)

request
fromFile:(NSURL *)
fileURL


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[0] <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[396] <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:


http://stackoverflow.com/questions/33278540/phasset-afnetworking-upload-multiple-videos


And no solution found so far.


Any thougts?