Forum Discussion

IrtezaAsad's avatar
IrtezaAsad
New member | Level 2
3 years ago

Javascript saver have no cancel option and the progress is not coming properly

Hello good people,
I'm using the dropbox saver in a NUXT application to save files to the user dropbox account after a certain task. There are some issues I'm facing while implementing this,

  • I didn't find an option to cancel the upload in the SDK.
    Sometimes the files are really big and we'd like to have a cancel option for the user for better experience. I see someone mentioned it's not there yet (here). Is it an upcoming feature? Can I somehow get notified if the feature is there?
  • For me the progress event () in the SDK says it'll return 0 to 1. But for me it's only returning 0 and 1. In some cases the progress 0 is not coming.
    progress: function (progress) {},

    For our user it'll help to see a progress percentage and for bigger files when the progress 0 is not coming in the UI it feels like the upload is "stuck" and it may confuse the users. Is there any option to get the exact trigger when the user clicks save in the dropbox window so I can show a loader to the users? And is there any way to get more progress events? (like 0, 0.3, 0.5, 1) 

My implementation 

 

 

const options = {
  success: () => {
    this.$emit('saved')
  },
  // Currently when the progress is 0 I'm starting the loader.
  progress: (progress) => {
    this.$emit('progress', progress*100)
  },
  cancel: () => {
    // showing the cancel alert
  },
  error: (errorMessage) => {
    // showing the error alert
  },
}

 

 

 

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

    The Dropbox Saver doesn't offer a way to cancel an ongoing save job, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. I'll follow up here if/when I have any news on your feature request. (Note that the thread you linked to was actually about uploading via the JavaScript SDK for the Dropbox API, not the Saver, so this is a separate feature request.)

     

    The Dropbox Saver progress callback is supposed to automatically report values between 0 and 1 when available, but it sounds like that may not be working correctly currently. We'll look into it and I'll follow up here with any updates.

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

      The progress should now be getting reported properly again.

       

      Note that progress will not be reported if the source URL does not return Content-Length.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,940 PostsLatest Activity: 23 hours ago
350 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!