Hello, I'm trying to upload a file to my Dropbox account through javascript.
Actually, I've been using this:
var dbx = new Dropbox.Dropbox({ accessToken: ''+data.dropbox_key+'', fetch: fetch });
dbx.filesUpload({path: ''+data.dropbox_path+'' + data.file.name, contents: file})
the file blob/object was getting it from the input file
But actually I'm building another way to upload files and in this way, I don't have an input to get the file/object but the URL.
So my idea was something similar to this:
var file = "https://www.imperva.com/blog/wp-content/uploads/sites/9/2018/04/B64-8.png";
var dbx = new Dropbox.Dropbox({ accessToken: ''+data.dropbox_key+'', fetch: fetch });
dbx.filesUpload({path: ''+data.dropbox_path+'' + data.file.name, contents: file})
But it uploads the file corrupted, so any way to upload using Javascript but using a URL as the source of the file?
Thanks!