I am trying upload multiple file using service stack. Below code is working fine for one file upload. I want to upload multiple file. Please let me know what change should be required so that below codes work for multiple files upload also.
public class Hello : IRequiresRequestStream
{
Stream RequestStream { get; set; }
}
At client side I am using 'multipart/form-data' for file upload.
See the documentation on Uploading Files,
IRequiresRequestStream
is only for accessing the Request Body as a Stream of Bytes, to process multiple files uploaded withmultipart/form-data
use thebase.Request.Files
property instead, e.g:Uploading Files
You can access uploaded files independently of the Request DTO using
Request.Files
. e.g:ServiceStack's imgur.servicestack.net example shows how to access the byte stream of multiple uploaded files, e.g: