我想在 asp.net 核心中使用 resumable.js,但有些代码在 .net 核心中不起作用,例如:
private async Task<bool> readPart(MultipartFormDataStreamProvider provider)
{
try
{
await Request.Content.ReadAsMultipartAsync(provider);
ResumableConfiguration configuration = GetUploadConfiguration(provider);
int chunkNumber = GetChunkNumber(provider);
// Rename generated file
MultipartFileData chunk = provider.FileData[0]; // Only one file in multipart message
RenameChunk(chunk, chunkNumber, configuration.Identifier);
// Assemble chunks into single file if they're all here
TryAssembleFile(configuration);
return true;
}
catch
{
return false;
}
}
如何更改 Request.Content.ReadAsMultipartAsync 以在 .net 核心中使用?