cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

downloadURL throwing a exception Operation Not Permitted

downloadURL throwing a exception Operation Not Permitted

FahadG
Explorer | Level 4

 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 10

FahadG
Explorer | Level 4

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
Dropbox Staff
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
Explorer | Level 4

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
Dropbox Staff

@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
Explorer | Level 4

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

KK4iOS
Explorer | Level 4

Please find the solution to our issue on the Github issue:

https://github.com/dropbox/dropbox-sdk-obj-c/issues/125

 

AlessandroB
New member | Level 2

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

AlessandroB
New member | Level 2
I have same problem... but your solution isn't good for me... please help me...

KK4iOS
Explorer | Level 4

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    AlessandroB New member | Level 2
  • User avatar
    KK4iOS Explorer | Level 4
What do Dropbox user levels mean?