Search code examples
.netrestfile-uploadopenrasta

Can you post a file, and a resource at the same time in OpenRasta?


Is it possible to upload a file, and post meta data (in the post body) at the same time in OpenRasta? and if so, do you have an example of how to do this?


Solution

  • I'm not sure I understand the question? When you upload a file from an html form, you get the whole form formatted as multipart/form-data, which means each field gets its own value sent alongside the files.

    You only need to define your handler method as Post(string formValue, IFile file) and it'll work as is.