0

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
  • Please clarify your question, what browsers have to do with server side storing to DB ? Commented May 12, 2012 at 19:18

1 Answer 1

2

You can read the Request Stream into a MemoryStream and then reading all bytes from the memory stream will give you a byte[]

Sign up to request clarification or add additional context in comments.

1 Comment

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();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.