“CFNetworkDownload_vHWw1E.tmp”couldn’t be moved. What is this?

Hi!


We sell books as IAPs in our app 'Little Stories.' Very few users can't download them after making a purchase. They get this error:

“CFNetworkDownload_vHWw1E.tmp” couldn’t be moved because you don’t have permission to access “LittleStoriesDownloads”.


This happens at the moment when the app tries to move downloaded files in the directory:
file:///private/var/mobile/Containers/Data/Application/35C34F6A-EC7F-4787-BFE3-14C90A661249/tmp/LittleStoriesDownloads




Affected iOS: 10.2 - 11.2


Who knows why this is happening?

Answered by nikolay.dzhulay in 283414022

Hi, I met such issue when used 'NSTemporaryDirectory' on iOS. Was unable to reproduce on my devices in bebug, but saw it in logs from users.

1. Recomended method of NSFileManager was not sutable for me. Even if it was ok to lost file between starts, I would like to save path between starts, to not download again, since it file from background session and big one.

2. '

func url(for directory: Bool) throws -> URL
' recreate folder again and again on every run. Which means that I can't delete it manually.

3. At the same time file temporal, after processing archive I need delete it.


After all of these, I decided to use cache folder, even while file really tmp and for one processing. After these changes issue disappears, recomend you to do the same!

Accepted Answer

Hi, I met such issue when used 'NSTemporaryDirectory' on iOS. Was unable to reproduce on my devices in bebug, but saw it in logs from users.

1. Recomended method of NSFileManager was not sutable for me. Even if it was ok to lost file between starts, I would like to save path between starts, to not download again, since it file from background session and big one.

2. '

func url(for directory: Bool) throws -> URL
' recreate folder again and again on every run. Which means that I can't delete it manually.

3. At the same time file temporal, after processing archive I need delete it.


After all of these, I decided to use cache folder, even while file really tmp and for one processing. After these changes issue disappears, recomend you to do the same!

Thanks! It helped!!

I'm running into this in a particular context for iOS 13:
  • A development build running on a device.

I don't run into this for:
  • A development build running on a simulator.

  • A distribution build running on a device.

Has anyone figured out anything more on how to deal with this issue?
“CFNetworkDownload_vHWw1E.tmp”couldn’t be moved. What is this?
 
 
Q