cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Get summer ready with Dropbox basic - travel documents, plans, progress reminders and more, right over 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: 

Javascript Saver fails with URL.createObjectURL(blob)

Javascript Saver fails with URL.createObjectURL(blob)

tomatosmoothie
Explorer | Level 3
var optionssave = {
        success: function() {
            console.log("Yay! File saved to dropbox");
        },
        cancel: function() {
            console.log("Whoops file not saved!");
        },
        error: function(errorMessage) {
            console.log(errorMessage);
        }
    };

var blob = new Blob([setxml], {
            type: "text/plain;charset=utf-8"
});
var bloburlsav = URL.createObjectURL(blob);


Dropbox.save(bloburlsav, filename, optionssave);

Dropbox file chooser is working fine.

The dropbox file saver reaches to the point of displaying the file name and the save button, on clicking the save button, it displays, "Failed to load request" (screenshot attached)

 

You can visit the link live: https://tomatosmoothie.github.io/recipes/ and try it if you have the time.

 

Thanks.

Screenshot at 2018-03-26 16-57-18.png

 

8 Replies 8

Re: Javascript Saver fails with URL.createObjectURL(blob)

Greg-DB
Dropboxer
The Dropbox Saver doesn't support blob URLs, but I'll pass this along as a feature request.

Re: Javascript Saver fails with URL.createObjectURL(blob)

tomatosmoothie
Explorer | Level 3

Thanks for your reply. I guess, I'll just hide the button for now.

Is there any specific place/page/channel I can follow to see if/when this feature is maybe added?

 

 

Re: Javascript Saver fails with URL.createObjectURL(blob)

Greg-DB
Dropboxer
I'll make a note to follow up on this thread if/when this is implemented.

Re: Javascript Saver fails with URL.createObjectURL(blob)

tomatosmoothie
Explorer | Level 3

Thank you so much, appreciate it.

Re: Javascript Saver fails with URL.createObjectURL(blob)

Jake9
New member | Level 2

I got lost in the same blob trap, but found a solution...

csvFile = build up a string of the whole file...

const dataURI = 'data:text/plain,' + encodeURIComponent(csvFile);
Dropbox.save(dataURI, "filename.csv", options);

Re: Javascript Saver fails with URL.createObjectURL(blob)

Jake9
New member | Level 2

the "ampsersand colon semicolon" is just a colon.

Re: Javascript Saver fails with URL.createObjectURL(blob)

quartertone
New member | Level 2

Any progress on this feature?

Re: Javascript Saver fails with URL.createObjectURL(blob)

Greg-DB
Dropboxer

@quartertone No, unfortunately I don't have any news on this request.

Poll
Which Dropbox Plan do you have?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    quartertone New member | Level 2
  • User avatar
    Jake9 New member | Level 2
  • User avatar
    tomatosmoothie Explorer | Level 3
What do Dropbox user levels mean?
Need more support?