cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more 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: 

Acquire save path from Dropbox saver

Acquire save path from Dropbox saver

JohnWeisz
Explorer | Level 4

It has been discussed before that the JavaScript-based Dropbox saver by spec does not resolve with the path of the saved files. However, we have a use case that requires this (getting the path to a saved resource).

 

Now we could certainly hack together something among the following files:

 

  1. build a hopefully unique fingerprint of the file
  2. save the file to Dropbox, wait for it to complete
  3. harvest metadata for every single file on the user's Dropbox
  4. attempt to match which file was just uploaded

 

This certainly isn't bandwidth or privacy-friendly, and we sure don't want neither Dropbox nor our users to get suspicious about an activity log that this may create. Can you perhaps recommend an alternative approach to brute-forcing a file match?

 

Edit

 

I've been checking out http/documentation#files-search, which is a step forward to getting this done more efficiently.

3 Replies 3

dialbro
New member | Level 2

 solve your problem.

JohnWeisz
Explorer | Level 4

I don't *have* a problem, I'm looking for a more sensible approach to a possible use case, preferably from people with some direct experience in the matter.

 

That said, I sincerely, and respectfully doubt a generic support firm from India, and one advertising itself on forums, would be of any help to us.

Greg-DB
Dropbox Staff

@JohnWeisz Thanks for writing this up! I'm sending this along as a feature request to have the Saver return the file path, though unfortunately I can't promise if or when that would be implemented.

 

I'm afraid I also don't have a great workaround to offer. The search method you mentioned may work for you, as you mentioned. Note that the resulting file name can differ though, e.g., adding a "(1), etc." if there was already a file with the same name in the folder.

 

Alternatively you could try using /2/files/list_folder/get_latest_cursor before initiating the save operation, and then calling /2/files/list_folder/continue after it finishes. This isn't perfect as it may pick up other changes, but it would be a more efficient way to narrow down the entries and find the newly saved file.

 

(Also, I imagine there's a reason you want to use the Saver, but it's worth mentioning that if you have API access to the account anyway, you can forgo using the Saver itself to begin with, and upload the file data using /2/files/upload directly.)

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    JohnWeisz Explorer | Level 4
  • User avatar
    dialbro New member | Level 2
What do Dropbox user levels mean?