Skip to content

Conversation

maliming
Copy link
Member

@maliming maliming commented Apr 1, 2021

Resolve #8298

Now we can use IRemoteStreamContent to handle files just like IFromFile.
https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-5.0

Configure<AbpAspNetCoreMvcOptions>(options =>
{
    options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(CreateFileInput));
    options.ConventionalControllers.FormBodyBindingIgnoredTypes.Add(typeof(CreateMultipleFileInput));
});

public class CreateFileInput
{
    public string Name { get; set; }

    public IRemoteStreamContent Content { get; set; }
}

 public class CreateMultipleFileInput
{
    public string Name { get; set; }

    public IEnumerable<IRemoteStreamContent> Contents { get; set; }

    public CreateFileInput Inner { get; set; }
}

@maliming maliming added this to the 4.3-patch milestone Apr 1, 2021
@maliming maliming marked this pull request as draft April 1, 2021 06:32
@maliming maliming requested a review from hikalkan April 1, 2021 06:52
@maliming maliming marked this pull request as ready for review April 1, 2021 06:52
@hikalkan hikalkan modified the milestones: 4.3-patch, 4.3-final Apr 1, 2021
@hikalkan hikalkan merged commit 965db4d into rel-4.3 Apr 1, 2021
@hikalkan hikalkan deleted the IRemoteStreamContent-patch branch April 1, 2021 07:15
maliming added a commit that referenced this pull request Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants