Merge pull request #3116 from zHaytam/dev

Add GetAllBytesAsync to AbpFormFileExtensions
pull/3136/head
maliming 5 years ago committed by GitHub
commit 577183504d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,5 @@
using System.IO;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Http
{
@ -11,5 +12,13 @@ namespace Microsoft.AspNetCore.Http
return stream.GetAllBytes();
}
}
public static async Task<byte[]> GetAllBytesAsync(this IFormFile file)
{
using (var stream = file.OpenReadStream())
{
return await stream.GetAllBytesAsync();
}
}
}
}

Loading…
Cancel
Save