Skip to content Skip to sidebar Skip to footer

Send Arraybuffer From Angularjs To C# Endpoint

I have an ArrayBuffer in angularjs that I am trying to send to my backend endpoint in c#, I thought it was a regular byte array but it's not mapping appropriately What would an Ar

Solution 1:

I had a situation of same some long days back. What I did was, I converted the array buffer data to base 64 string in the js side and sent it to the backend c# code using post method,and again I decoded it to array buffer to regenerate the file on server side. By this way I achieved the mapping.

I used this code which helps to convert the array buffer to base 64 string in JS. and this api of .net framework to convert back the base 64 string to file buffer.

I hope this would help you.

Post a Comment for "Send Arraybuffer From Angularjs To C# Endpoint"