I'm trying to upload files with Ajax (Valums Ajax File Upload) in ASP.NET MVC3, my codes works fine for IE but not for Firefox nor Chrome, I get application/octet-stream for those on server side, how can I read and convert this to byte[] in order to save them in DB? thanks
1 Answer
You can read the Request Stream into a MemoryStream and then reading all bytes from the memory stream will give you a byte[]
1 Comment
ePezhman
I did so but it only inserts 0x in DB, I have code like this : MemoryStream ms = new MemoryStream(); stream.CopyTo(ms); byte[] byts = ms.ToArray();