Forum Discussion

FahadG's avatar
FahadG
Explorer | Level 4
9 years ago

downloadURL throwing a exception Operation Not Permitted

 The following code is throwing an exception, something about file permission with NSURLSession:

 

[[[[DBClientsManager authorizedClient].filesRoutes downloadUrl: remotePath overwrite: true destination: destURL] setResponseBlock: ^(DBFILESMetadata *fileData, DBFILESDownloadError *downloadError, DBRequestError *requestError, NSURL *urlGot) {
    if (requestError != nil) {
       // I'm getting a Operation Not Permitted, something about 'Move' not allowed as app does not own the file 

    }
  }] setProgressBlock: ^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) {
  }];

 

10 Replies

  • FahadG's avatar
    FahadG
    Explorer | Level 4
    9 years ago

    The exact error:

     

    DropboxClientError[{
    NSError = "Error Domain=NSCocoaErrorDomain Code=513 \"\U201cCFNetworkDownload_1qXMQT.tmp\U201d couldn\U2019t be moved because you don\U2019t have permission to access \U201ctmp\U201d.\" UserInfo={NSSourceFilePathErrorKey=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/com.xxx.xxx/CFNetworkDownload_1qXMQT.tmp, NSUserStringVariant=(\n Move\n), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/3E2A0069-62CB-49A5-9505-1879C7900069/tmp/o_u_k_4d1e7c7e562343f68a703ff3bcf58369_p__i_6842341270ab4113b325fa5bbc721a3f_d_.tod.gz, NSFilePath=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/com.xxx.xxx/CFNetworkDownload_1qXMQT.tmp, NSUnderlyingError=0x1702540d0 {Error Domain=NSPOSIXErrorDomain Code=1 \"Operation not permitted\"}}";
    }];
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    It sounds like you don't have permission to write to the local path specified by your "destURL". Can you check that value and confirm if you should or shouldn't have permission to it?

    There was also a thread about this error message here which may be useful:

    https://github.com/dropbox/dropbox-sdk-obj-c/issues/60
  • KK4iOS's avatar
    KK4iOS
    Explorer | Level 4
    9 years ago

    Dear Greg,

    I am running exactly in the same problem. It works for us on iPad with iOS 9.3.5 and iOS 10.2 but it fails with the follwong message on a iPad Pro 12.9" with iOS 10.3 (and I made a pod update this moring to version 3.0.10):

     

    NSError = "Error Domain=NSCocoaErrorDomain Code=513 \"\U201eCFNetworkDownload_usQ10T.tmp\U201c konnte nicht bewegt werden, da du nicht \U00fcber die erforderlichen Zugriffsrechte f\U00fcr \U201etmp\U201c verf\U00fcgst.\" UserInfo={NSSourceFilePathErrorKey=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/com.-----.——/CFNetworkDownload_usQ10T.tmp, NSUserStringVariant=(\n    Move\n), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/03757827-B45C-4CFD-9F34-DFE20371E541/tmp/Pepsi.jpg, NSFilePath=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/com.-----.-----/CFNetworkDownload_usQ10T.tmp, NSUnderlyingError=0x17045a340 {Error Domain=NSPOSIXErrorDomain Code=1 \"Operation not permitted\"}}"

     

    I implemented also the proposals with the "sharedContainerIdentifier" from your referring link (https://github.com/dropbox/dropbox-sdk-obj-c/issues/60) but I does not solve the problem:

     

     

        DBTransportDefaultConfig *transportConfiguration = [[DBTransportDefaultConfig alloc] initWithAppKey:DROPBOX_APP_KEY
                                                                                                  appSecret:DROPBOX_APP_SECRET
                                                                                                  userAgent:nil
                                                                                                 asMemberId:nil
                                                                                              delegateQueue:nil
                                                                                     forceForegroundSession:NO
                                                                                  sharedContainerIdentifier:[NSBundle mainBundle].bundleIdentifier];
        [DBClientsManager setupWithTransportConfig:transportConfiguration];

     

    Should I open a separate issue for that on Github?

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    KK4iOS It looks like you did open a new issue on GitHub for this, so we'll take a look and follow up there.

  • KK4iOS's avatar
    KK4iOS
    Explorer | Level 4
    9 years ago

    Thank's Greg, yes I did. Let's follow up there....

  • AlessandroB's avatar
    AlessandroB
    New member | Level 2
    9 years ago

    I have same problem... but your suggestion can't resolve for me... please help me...

  • AlessandroB's avatar
    AlessandroB
    New member | Level 2
    9 years ago
    I have same problem... but your solution isn't good for me... please help me...
  • KK4iOS's avatar
    KK4iOS
    Explorer | Level 4
    9 years ago

    We still run our app with the Dropbox SDK obj c version 3.0.10 and have not received yet any issues from our users. Maybe you use another/later version where this problem was introduced.

    I recommend, that you open a new issue directly on GitHub referring to your used Dropbox SDK version

  • AlessandroB's avatar
    AlessandroB
    New member | Level 2
    9 years ago

    My problem is now resolved... with versione 3.0.18 of Dropbox SDK that fix this bug.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!