I need to store the image in my database in byte[]
I am sending the image from Javascript to mvc controller using ajax
In my javascript
var files = $("#MyImage").get(0).files;
formData.append('files', files);
in my MVC Controller
using (var binaryReader = new BinaryReader(Request.Files[0].InputStream))
{
fileData = binaryReader.ReadBytes(Request.Files[0].ContentLength);
}
Is it a correct way to store the image or I am doing this wrong?
please suggest