-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Accessing FORM in a HttpPost #19
Comments
Hmmm. That's a really good question. You can't at the moment but I'd be super interested in your thoughts on how this could work. In an ideal world what would the command look like? |
My original attempt was something like this: public class PostFileForUploadCommand : ICommand<FileUploaded>
{
public IFormCollection Form { get; set; }
} You would then just have access to the form object like you do if you have the HttpRequest. Thanks for the speedy reply! |
Thanks for that - makes sense. Bit snowed under with client work at the moment but I'll see if I can sneak something in along those lines as should be fairly simple. |
I managed to knock up a proof of concept of this on the train this morning - not tested yet but no real problems. |
Sounds great! let me know if I can help in any way. |
This is now in v0.18.1 on NuGet now. It works just per your example: it will look for properties of type IFormCollection and map the HTTP request property onto them. Just realised I forgot to document it in the guide but will do that shortly. |
I am looking to get hold of the form object from the HTTP request (
reqest.Form.Files
)to be able to get a file that is being sent to a function. We currently get this through the request in the function call and im unsure on how to map this to a Command. Help appreciated!Thanks
Shaun
The text was updated successfully, but these errors were encountered: