Hi All,
I'm new to Dropbox API and I'm trying to upload image files from our website to dropbox using api. I'm using FETCH to POST data to dropbox and the file is uploading.However, the image is not getting loaded in dropbox. Below is code that I use:
fetch('https://content.dropboxapi.com/2/files/upload', {
method: 'post',
body: file1, //Base64
headers: {'Authorization': 'Bearer '+MY_TOKEN,
'Content-Type': 'application/octet-stream',
'Accept': 'application/json',
'Dropbox-API-Arg': '{"path": "/test1/test.jpg","mode": "add","autorename": false,"mute": false,"strict_conflict": false}'
}
}).then(function(response) {
console.log(response.json());
});
Please help me out with this issue. Thank you