相关文章推荐
俊逸的柠檬  ·  JavaScript Copy ...·  2 月前    · 
阳刚的数据线  ·  Fun with array ...·  2 月前    · 
正直的铁链  ·  ulab.numpy – ...·  1 月前    · 
玩命的拖把  ·  四川大学就业指导中心·  1 年前    · 
含蓄的人字拖  ·  抚顺纪检监察网·  1 年前    · 
稳重的佛珠  ·  JAR will be empty - ...·  1 年前    · 

How to convert iFormFile to Byte array?, I have tried the below, but it keeps give me Cannot access a disposed object. Object name: 'FileBufferingReadStream

                    foreach (var formFile in supportingFiles)
                        long fileSize = formFile.Length;
                        string fileType = formFile.ContentType;
                        if (fileSize > 0)
                            using (var stream = new MemoryStream())
                                formFile.CopyTo(stream);
                                var bytes = stream.ToArray();
                                // do some stuffs