Using FileUpload.FileContentgives you Streamto work.
See MSDN .
For instance:
void WriteFileLength()
{
if (fileUpload.HasFile)
{
var fileStream = fileUpload.FileContent;
var messageFormat = "The file is {0} bytes in length"
Response.Write(string.Format(messageFormat, fileStream.Length));
}
}
source
share