0

i want use resumable.js in asp.net core but some codes not work in .net core , Example :

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;
    }
}

how to change Request.Content.ReadAsMultipartAsync for use in .net core ?

ResumableController.cs

HMZ
  • 2,949
  • 1
  • 19
  • 30
mahdi
  • 93
  • 1
  • 11
  • What you want is to upload file in asp.net core, right? If so, in asp.net core, `IFormfile` is a better choice. – LouraQ Oct 01 '20 at 08:30

1 Answers1

0

According to the devs this extension has been updated for .net core. See this issue on github.

Just download this nuget package and the extension will be available:

Microsoft.AspNet.WebApi.Client

HMZ
  • 2,949
  • 1
  • 19
  • 30
  • no its not work , just help to me , What is the equivalent of this code in .net core? `await Request.Content.ReadAsMultipartAsync(provider);` – mahdi Sep 27 '20 at 06:06