Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
HrcKuhar
4 years agoNew member | Level 2
Upload file using jquery
I'm trying to upload an image to dropbox using jquery, but I get an error for cors policy block. Is there another way to upload?
My code:
var xhr = new XMLHttpRequest();
xhr.upload.onpr...
HrcKuhar
4 years agoNew member | Level 2
I'm using this code to upload file but I get an error:
"Value should match pattern '\\A(?:(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*))\\z' (Parameter 'path')"
var client = new DropboxClient("<access_token>, "<access key>", "<secret key>");
try
{
await Upload(client, "https://www.dropbox.com/sh/...dl=0/", <image filename>, "AvatarImage"); -- this url is a link to share folder
}
catch (Exception ex)
{
var error = ex.Message + ex.Source;
}
async Task Upload(DropboxClient dbx, string folder, string file, string content)
{
using (var mem = new MemoryStream(Encoding.UTF8.GetBytes(content)))
{
await dbx.Files.UploadAsync(
folder + "/" + file,
WriteMode.Overwrite.Instance,
body: mem);
}
}
About Discuss Dropbox Developer and API
Explore Dropbox Developer & API discussions with developers like you.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!