Greg-DB Dropbox Community Moderator

Comments

  • In this code I see you're using the 'finish' method, presumably once per file, to finish the uploads. If you send off multiple of these at the same time, you will cause lock contention. You should use a single 'finish_batch' to finish multiple file uploads in a single call to avoid this. (Or, only send the multiple…
  • Thanks for the post! It sounds like you're referring to the recent deprecation of the 'include_media_info' parameter on /2/files/list_folder. Unfortunately this is necessary in order to support some changes on the Dropbox backend, but I'll send your feedback along to the team.
  • If you want to get a zip of a folder on Dropbox, the 'filesDownloadZip' method you already found is the right method. (If you only wanted a single file, you would use the 'filesDownload' method. In either case, when performing a download call like this in Node, if the call succeeds the resulting data is in the 'fileBinary'…
  • If has_more is false, you should be getting all of the results for that folder in the account for that access token. It doesn't look like you're doing anything wrong here, so we'll need to look into this more closely. Can you open an API ticket and share that 'whee.txt' file so we can investigate? Thanks in advance! 
  • I escalated this to the relevant engineering team in charge of the Dropbox web site. They reviewed this and unfortunately they're reporting that we can't offer a fix as this is only occurring in unsupported browsers. It is important going forward that you use officially supported browsers/versions, for the sake of…
  • Each of the /start, /append, and /finish endpoints, but not /finish_batch, can accept file data. You would need to use /append if there is more data than you can send in the /start and /finish requests. Upload sessions work by having you send only a portion of the file's data per request. Exactly how much data you send per…
  • Thanks! That's helpful. I'm bringing this up with the team. Again though, I unfortunately can't promise a fix as this browser isn't officially supported. 
  • @"L0h1cB3n3yz3t" I don't know if dn1 has any information they can share to help with this, but please feel free to open a new thread with the specifics of what's currently not working for you and we'll be happy to help with whatever we can regarding the Dropbox API.
  • Thanks for the information! Can you share the User-Agent string though? You can get it by going here in the browser, for instance: https://www.google.com/search?q=What%27s+my+User+Agent
  • @"hosamsandid" The variable 'j' was used in the original code sample shared in this thread, but the definition of its value wasn't shown. In that context though, it would've just been a file name, like "example.jpg". It was used both on the Dropbox API, formatted as "/example.jpg", for instance, and to open a local file.
  • I just tried this myself with an Android 6.0 emulator, and I'm not seeing the behavior you're seeing: Can you share the exact User-Agent for the browser you're using, as well as any JavaScript errors from the page?
  • I see, thanks for clarifying. Unfortunately, as that browser is not officially supported, I can't promise a fix, but I will bring this up with the team.
  • @"jose2020" @"Wikt0r" Thanks for the reports! We're looking into it.
  • If you want to commit multiple file uploads at once, and avoid the you should use /2/files/upload_session/finish_batch. That endpoint does not only take a single file name/upload session ID. Its UploadSessionFinishBatchArg.entries parameter takes a list of multiple UploadSessionFinishArg. You can find information on that…
  • The Dropbox API unfortunately does not offer a way to list folders only, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. As a workaround, you'll need to list everything and filter out the file entries client-side.
  • I'm not sure I understand your message. Can you clarify what you mean when you say you get a blank page from an API request? Dropbox API requests involve communicating with the Dropbox API servers, typically exchanging JSON, not HTML web pages, over HTTPS. Are you referring to the Dropbox app authorization page itself…
  • As a security feature, all redirect URIs used for an app must be pre-registered for the app. If you attempt to use a redirect URI that hasn't been registered, you'll receive this error. To register an OAuth 2 redirect URI, access the app's page on the App Console by clicking on the app's name there:…
  • Can you share the relevant code and output so we can take a look and advise? (Feel free to share privately by opening an API ticket if you'd prefer.) Be sure to redact the access token though. Based on your description however, it sounds like you might be running in to an issue because you're not specifying the right…
  • For reference, the error handling on the API itself should be fixed now.
  • The error handling on the API should be fixed now. This case should no longer return a 500 and will instead properly return a 409 for revisions that can't be restored.
  • Apologies for the delay! It looks like your post got caught in the forum's spam filter for some reason. It was just restored. Anyway, can you share the code you're using to upload the files in this case? It sounds like something may be going wrong during the upload resulting in the incorrect data getting committed.
  • Are you setting the 'Content-Type' value for your request? It would be in your custom_header variable but you didn't share the definition for that. You should set it like: "Content-Type": "application/json" If you don't, the API call parameters won't get sent properly. You can use the API Explorer to help prototype these…
  • The 'offset' value is "The amount of data that has been uploaded so far. We use this to make sure upload data isn't lost or duplicated in the event of a network error.". That is to say, it should be the number of bytes that you have already uploaded so far for that particular upload session. You should keep track of this…
  • The 'restricted_content' error from the /2/files/download endpoint on the Dropbox API indicates that the file being requested "cannot be transferred because the content is restricted. For example, sometimes there are legal restrictions due to copyright claims." If you believe you've encountered files that have incorrectly…
  • The Dropbox API doesn't offer a way to directly link to and open files in the native app like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. You can create shared links, but those would only open the Dropbox web site. Depending on the platform (e.g., this…
  • No, unfortunatelty there isn't a batch option for sharing folders in particular, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 
  • @"bramburn" Please try replacing this line: dbx = dropbox.Dropbox(ACCESS_TOKEN) with this instead: dbx = dropbox.Dropbox(ACCESS_TOKEN, timeout=None) Then try again and let me know if that does or doesn't help. Also, you don't need those time.sleep calls, so you can remove those.
  • Thanks for the post, and apologies that the error message isn't more helpful in this case. For this `internal_error` case, I looked it up and I can confirm that it's actually due to "lock contention". That's a result of how Dropbox works on the backend. It's a technical inability to make multiple modifications, such as…
  • Thanks for trying that. That output indicates the upload was succesful, so the issue does seem to be specific to your Python environment/code. We'll take a closer look at the code you shared.
  • To clarify a bit, you need one "upload session" per file. Each upload session gets its own session ID. When adding data to a single upload session, you need to identify how much you've already added to that upload session by using the "offset" value. This helps make sure you're uploading the right pieces. If you specify…