Upload image data from local file

With incorrect headers, the response returns 401.

Photo by Ashwini Chaudhary on Unsplash

Failure in my case

I was trying to post image data from local PC area as well as from Smartphone. I have been using XMLHttpRequest by adding an extra header with queries so that server-side can catch them. All is fine if I post metadata such a string, however when I have to post image…