Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a new property Name to MultipartItem class #973

Closed
wants to merge 4 commits into from

Conversation

javirszhang
Copy link

consider following suituation, my webapi get upload files from Request.Form.Files so that IFormFile.Name is very important.

[HttpPost("upload/{bucket}")]
public ApiResult<List<FileUploadResponseDTO>> FileUpload(string bucket)
{
    List<FileUploadResponseDTO> list = new List<FileUploadResponseDTO>();
    MediaFileUploadProvider mediaFile = new MediaFileUploadProvider(bucket);
    foreach (var file in Request.Form.Files)
    {
        var fileDTO = mediaFile.Execute(file.Name, file.FileName, file.OpenReadStream());
        if (fileDTO != null)
        {
            list.Add(fileDTO);
        }
    }
    return list;
}

IFormFile.Name determins file means, it can not use a fixed parameter name.

What kind of change does this PR introduce?
enhancement, let users can set Content-Disposition name attribute when necessary.

What is the current behavior?
Always use the parameter name as the Content-Disposition name attribute.

What is the new behavior?
Add a new property Name to MultipartItem class, so we can set it when necessary.

What might this PR break?
nothing

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

…he name attribute of Content-Deposition can be set freely instead of use the parameter name
@dnfadmin
Copy link

dnfadmin commented Sep 24, 2020

CLA assistant check
All CLA requirements met.

Jason added 3 commits September 25, 2020 10:02
…he name attribute of Content-Deposition can be set freely instead of use the parameter name
merge from origin repository
@clairernovotny
Copy link
Member

Included in #1002

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants