Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

joost2076's avatar
joost2076
Explorer | Level 3
9 years ago
Solved

download blob using dropbox Saver

Hi,

I am trying to use the dropbox Saver (https://www.dropbox.com/developers/saver) to download a json blob from my desktop (ubuntu).

 

This leads to an error:  Url "blob:http://localhost:5000/f58ddb0b-48ed-46ab-87b3-f45a1ee8a7df" uses unsupported scheme

 

Is it possible to download a blob using Saver ? If so, any ideas what I am doing wrong? 

The code i used is as follows: with url = blob:http://localhost:5000/f58ddb0b-48ed-46ab-87b3-f45a1ee8a7df", and filename = "yourmap.json"

 

Thanks, 

Joost

 

function create_dropbox_save_button(url, mapname){
    var options = {  
        success: function () {
            // Indicate to the user that the files have been saved.
            alert("Success! Files saved to your Dropbox.");
        },
        progress: function (progress) {console.log(progress)},
        cancel: function () {},
        error: function (errorMessage) {console.log(errorMessage)}
    };
    var button = Dropbox.createSaveButton(url, mapname, options);
    document.getElementById("dl_dropbox").appendChild(button);
}

 

  • The Dropbox Saver doesn't support blobs, local files, or data URIs unfortunately, but I'll pass this along as a feature request.

5 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    The Dropbox Saver doesn't support blobs, local files, or data URIs unfortunately, but I'll pass this along as a feature request.
  • blurymind's avatar
    blurymind
    New member | Level 2
    7 years ago

    Hi, I need this too in order toimplement saving to db from https://yarnspinnertool.github.io/YarnEditor/

    Is there an alternative approach to blobs? I want to write a simple string from my webapp to a dropbox folder - as a text file. Is that possible or not? If so how and why is your documentation lacking a simple example?

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

    blurymind No, the Dropbox Saver still doesn't support saving blobs, or some other local alternative. I'll add your vote to the feature request, but I can't promise if or when that might be implemented.

    The Dropbox Saver only supports saving from Internet-accessible URLs. If you want to use the Saver to save a text file, you'll need to supply the data via an Internet-accessible URL.

    Alternatively, you can use the Dropbox API, e.g., via the official Dropbox JavaScript SDK, to upload directly to Dropbox from the browser, but that would be more work and would require you to have the user explicitly authorize the app via the OAuth app authorization flow. 

  • blurymind's avatar
    blurymind
    New member | Level 2
    7 years ago

     

    I was able to achieve creating and saving a new text file by doing this and passing it as an url to the saver: 

    https://github.com/YarnSpinnerTool/YarnEditor/blob/master/src/js/classes/utils.js#L278

    however there is a catch. Both the saver and the chooser only function when running from the web app hosted here:

    https://yarnspinnertool.github.io/YarnEditor/

    Perhaps more annoyingly, the saver can not overwrite files when asked to.

    Dropbox denies them both access if running from a localhost server or a hosted file. This is why I disabled it for the electron version of yarnEditor.

    Wish I could use one codebase that is simple and effective to achieve saving and loading - but the current  api doesn't seem to have an easy answer to thi

     

     

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

    blurymind Thanks for sharing this! Please note though that the Saver only officially supports HTTP and HTTPS URIs, so while data URIs like this may happen to work, I don't recommend relying on that. It may not work consistently, or may break without notice.

    Also, yes, the Chooser and Saver do need to run on a hosted page where they can verify the domain against the pre-registered Chooser/Saver domains for the app key being used.

    The Saver also doesn't currently support overwrite or other write modes, but I'll pass these along as feature request as well.

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!