Forum Discussion

toonladder's avatar
toonladder
Explorer | Level 3
8 years ago

Saver fails with dataURI

For several years my web-app used the Saver with a dataURI successfully. Recently I discovered that it now fails consistently and returns "null" as error message. Normally the Saver returns an error message like "protocol scheme not supported". Not so with dataURI's. I just get "null".

Here is an example that worked in the past, but does not anymore:

Dropbox.save ('data:,hello', 'hello.txt', options);

The error call back in the options just receives "null". Did I miss a policy change concerning supported protocols of the Saver? If so, why not returning a meaningful error message?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Thanks for the report! While it did happen to work previously (at least under a certain file size), the Saver didn't officially support data: URIs. It looks like this did stop working, so we'll look into it. I can't promise a fix though, as it wasn't considered officially supported. If we don't get a fix for this, I'll ask the team to at least clarify the documentation and offer a better error message.

    • toonladder's avatar
      toonladder
      Explorer | Level 3

      Thanks for your quick reply, Greg.

      The server for my web-app is using the unprotected http:-protocol, so I cannot use the core-API (because Oauth requires a https: callback). The Saver is my only refuge for storing relatively small files (music score's) on Dropbox.

      Hoping for a fix,

       

      Toon

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff
        We highly recommend setting up TLS on your web app for the sake of security, but if you don't have that set up, but for reference, it is technically possible to still use the OAuth flow without it. You would use the "code" flow but omit the 'redirect_uri' parameter. The user would then need to manually copy/paste the resulting authorization code into your app, which would then exchange it for an access token:

        https://www.dropbox.com/developers/documentation/http/documentation#authorization

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 13 hours ago
352 Following

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 or Facebook.

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!