S
shapper
Hello,
I am receiving a HttpPostedFileBase from a web form.
When I debug it its ContentLength is 25310.
Then I try to convert it to Byte[]:
public Byte[] Convert(HttpPostedFileBase source) {
Byte[] destination = new Byte[source.ContentLength];
source.InputStream.Read(destination, 0, source.ContentLength);
return destination;
} // Convert
And at the end I get a byte [25310] but all bytes are 0.
Any idea what I might be doing wrong?
Thank You,
Miguel
I am receiving a HttpPostedFileBase from a web form.
When I debug it its ContentLength is 25310.
Then I try to convert it to Byte[]:
public Byte[] Convert(HttpPostedFileBase source) {
Byte[] destination = new Byte[source.ContentLength];
source.InputStream.Read(destination, 0, source.ContentLength);
return destination;
} // Convert
And at the end I get a byte [25310] but all bytes are 0.
Any idea what I might be doing wrong?
Thank You,
Miguel