I have a permission issue while going to fetch video from following url :
"file:///var/mobile/Media/DCIM/101APPLE/IMG_1111.mp4"
I am getting the following error , while going to get data from above url :
Error Domain=NSCocoaErrorDomain Code=257 "The file “IMG_1111.mp4” couldn\342\200’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/var/mobile/Media/DCIM/101APPLE/IMG_1111.mp4, NSUnderlyingError=0x1c0440f30 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
My code to get data is :
do {
let fileData = try Data.init(contentsOf:urlCheck)
print(fileData)
} catch {
print(error)
}
Any help will be appreciated. Thanks