Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Eric S.36's avatar
Eric S.36
New member | Level 1
10 years ago

uploading video through api not working

I'm using the IOs sdk and trying to upload a small video. It keeps giving me the following error 

[WARNING] DropboxSDK: error making request to /1/files_put/sandbox/YourFolder/BNaUmF.m4v - (-1005) Error Domain=NSURLErrorDomain Code=-1005 "The operation couldn’t be completed.

odly, it seemed to work one time, I didn't change the code ... I'm running on the device using iOS 7 

5 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Per the documentation, NSURLErrorDomain Code=-1005 is:

    NSURLErrorNetworkConnectionLost = -1005,

    Is the network connection on that device working properly? Is there anything on the network connection for that device that may be interfering? In any case, it may be good to implement some automatic retrying.

  • Eric S.36's avatar
    Eric S.36
    New member | Level 1
    10 years ago

    Te network connection seems to work fine, it's actually able to upload images in the same fashion but the short videos seem to be a problem, some are only 50k so I know it's not a file size issue it seems to fail every single time .... the very strange part is, that when I put a breakpoint in front of the call, it seems to work 

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

    Getting it to work by adding the breakpoint does seem strange, though perhaps that's causing a timing change. The error code does indicate a network issue though. Are you running multiple of these simultaneously? Perhaps the delay from the breakpoint is allowing your network connection to clear up.

    In any case, can you try it on another network connection? Also, trying on another device might be useful.

  • Eric S.36's avatar
    Eric S.36
    New member | Level 1
    10 years ago

    I'm wondering if the Error could be misleading ... I'm only making the call once, again for images it seems to work fine with no errors consistently, but with the video it fails ... I'm calling the function as soon as the video is done encoding .... my thought is that perhaps even though the completion event is fired, something in the file system is not done yet .... as a result It cant read the file. This is totally conjecture, but when I call the upload function after 50 ms, it works, so it leads me to believe maybe something like that is going on, and that the -1005 error is just red harring 

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

    I suppose that's possible. Trying different network connections/devices may help confirm or rule that out. Also, you may want to try simplifying things, e.g., remove the part where you use a newly encoded file and just try an existing local video file, to try to narrow this down.

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!