The official docs has source code that reads a HttpPostedFile.InputStream into a byte array.
How to convert a HttpPostedfile into a Byte()
peter liles
556
Reputation points
For Each postedFile As HttpPostedFile In PictureUpload2.PostedFiles
i am trying to get the postedfile and convert to byte() like:
Using s As Stream = PostedFile.InputStream
Using br As New BinaryReader(s)
Dim image As Byte() = br.ReadBytes(CType(s.Length, Int32))
without success. Only when i execute the following will it obtain the Byte Array ?
Dim image As Byte() = PictureUpload2.FileBytes
I am trying to recreate a thumbnail image of all the PostedFiles !
Developer technologies ASP.NET Other
3,597 questions