Share via

xamarin forms ios error msg: The file “CFNetworkDownload_qkPMxP.tmp” couldn’t be opened because you

WillAutioItrax 211 Reputation points
2021-10-15T14:33:32.83+00:00

One of the things that our app does is create and share photos. Staff take photos and upload them. Later other staff may need to download them to use on their device.

For iOS devices we use a CustomSessionDownloadDelegate to download several photos.
The Download stores the photo in a location that looks like this:

location=file:///var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/*/CFNetworkDownload_sfwacR.tmp

We want to copy the photo to a location, so we can easily access it in our app, that looks like this:

destinationURL=file:///var/mobile/Containers/Data/Application/B61707E5-758F-49AB-9529-37D2D3756B66/Documents/Playroom%20Overview.jpg

For some years now the following has done the job.

bool success = fileManager.Copy(location, destinationURL, out error);

Recently it started throwing an error and not doing the job. The error is:

The file “CFNetworkDownload_sfwacR.tmp” couldn’t be opened because you don’t have permission to view it.

I suspect that iOS tightened up its Permissions, but I can't find the one I need to allow this task to proceed.

Thanks for looking at this.

Developer technologies | .NET | Xamarin

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.