I am in process of sending the file along with HttpWebRequest. My file will be from FileUpload UI. Here I need to convert the File Upload to filestream to send the stream al
You can put a FileUpload file directly into a MemoryStream by using FileBytes (simplified answer from Tech Jerk)
MemoryStream
FileBytes
using (MemoryStream ms = new MemoryStream(FileUpload1.FileBytes)) { //do stuff }
Or if you do not need a memoryStream
byte[] bin = FileUpload1.FileBytes;