Skip to content

Pass dictionary to FileHandler #85

@DamianMehers

Description

@DamianMehers

In my case (and perhaps this is out of the ordinary) I need a header for a FilePart that is not one of the ones extracted from the parameters dictionary passed into ParseFilePart in StreamingMultipartFormDataParser.ParseFilePart

// Read the parameters
parameters.TryGetValue("name", out string name);
parameters.TryGetValue("filename", out string filename);
parameters.TryGetValue("content-type", out string contentType);
parameters.TryGetValue("content-disposition", out string contentDisposition);

... and subsequently passed to FileHandler:

FileHandler(name, filename, contentType, contentDisposition, fullBuffer, endPos - bufferNewlineLength, partNumber++);

Consequently I've modified (in my own copy) FileHandler to just take the Dictionary<string, string> parameters as a parameter and not pass in name, filename, contentType, contentDisposition:

FileHandler(parameters, fullBuffer, endPos - bufferNewlineLength, partNumber++);

This would be a breaking change, so I am not sure what to do ... are other people finding that they need a parameter that is not one of the ones that are passed?

I'm happy to submit a pull request if this change makes sense.

Metadata

Metadata

Assignees

Labels

Breaking ChangeThis change causes backward compatibility issue(s)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions