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

前端 未结 2 600
陌清茗
陌清茗 2021-01-04 18:36

I am downloading a file to a folder and I am validating that the file is indeed there in the code, but I am getting the above error. Can someone help me figure out why i don

相关标签:
2条回答
  • 2021-01-04 18:41

    Your documentsURL is the address of the Documents FOLDER in your app. It is not a FILE that you can get the contents of:

    /var/mobile/Containers/Data/Application/7FA4D6A9-2149-4053-BF08-22E94A00AE34/Documents

    0 讨论(0)
  • 2021-01-04 18:50

    Try

    fileURL.startAccessingSecurityScopedResource()
    //...
    fileURL.stopAccessingSecurityScopedResource()
    
    0 讨论(0)
提交回复
热议问题