我想知道如何替换这个方法。我使用netider6,内容和方法readasmultipartasync不可用。
示例代码:
private async Task<bool> readPart(MultipartFormDataStreamProvider provider)
{
try
{
InMemoryMultipartFormDataStreamProvider provider = null;
provider = await Request.Content.ReadAsMultipartAsync(new
InMemoryMultipartFormDataStreamProvider());
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;
}
}
我是说这条线
provider = await Request.Content.ReadAsMultipartAsync(new InMemoryMultipartFormDataStreamProvider());
谢谢
问候
1条答案
按热度按时间evrscar21#
你可以用类似
这将从窗体读取数据
对象包含类似于
IFormFile将表示使用Form推送到服务器的文件