0

I want to create a bitmap of each file in FileUpload, AllowMultiple set to True, but it's not working. In single file mode, I used to get bitmap from FileUpload.FileContent and it was OK.

foreach (HttpPostedFile file in flImage.PostedFiles)
{
    Bitmap originalBMP = new Bitmap(file);

Thanks for your kind help in advance!

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Kardo
  • 1,658
  • 4
  • 32
  • 52

1 Answers1

1

Use file.InputStream instead of file:

foreach (HttpPostedFile file in flImage.PostedFiles){
    Bitmap originalBMP = new Bitmap(file.InputStream);
}
amiry jd
  • 27,021
  • 30
  • 116
  • 215