cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We want to hear from you. What do you use Dropbox for?
Close

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: 
Highlighted

download blob using dropbox Saver

Explorer | Level 3

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);
}

 

1 Accepted Solution

Accepted Solutions
Highlighted

Re: download blob using dropbox Saver

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

View solution in original post

5 Replies 5
Highlighted

Re: download blob using dropbox Saver

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

View solution in original post

Highlighted

Re: download blob using dropbox Saver

New member | Level 2
New member | Level 2

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?

Highlighted

Re: download blob using dropbox Saver

Dropboxer
Dropboxer

@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. 

Highlighted

Re: download blob using dropbox Saver

New member | Level 2
New member | Level 2

 

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

 

 

Highlighted

Re: download blob using dropbox Saver

Dropboxer
Dropboxer

@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.

Polls
Do you know how to organize your files and folders?
<b>We have created a guide on folder best practice, so you can get organized now <a href="https://www.dropboxforum.com/t5/Business-Tips-tricks/Folder-structure-best-practice/m-p/428456#M39"><u>check it out here</u></a>.</b>

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?