Angular 1.x (latest)
I want to send a binary file (image for example) in an angularjs $http.post.
I have the data in a nodejs Buffer object, which is an implementation
Uint8Array.
I tried:
$http.post("https://content.dropboxapi.com/2/files/upload",
data,
{
headers: {
'Content-Type': 'application/octet-stream',
'Authorization': 'Bearer ' +
dSvc.GO.onlineStorage.D1.accessResponse.access_token,
'Dropbox-API-Arg': JSON.stringify({
"path": path,
"mode": "overwrite",
"mute": true
})
}
}
)
But when the data gets to the server, is is bigger, and the image is
corrupt.
If my starting point is a Buffer (Uint8Array) how do I get from there to a
field that can be sent in the body of an $http.post?
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.