I am trying to create my own S3 compatible server using self-hosted ServiceStack (version 4.0.31 on mono) and I need to support s3curl.pl format uploads. The problem is that they do not use mutipart uploads but appear to use the default http binary format. I already have ServiceStack working for multipart/form-data uploads. I have also looked at all applicable posts on related topics and none of them work for me. For example: ServiceStack - Upload files with stream and with Uri looked like it would address my problem. The problem is that I can't resolve RequestContext.Files for that solution.
Here is my curl command line (note that the Auth is bogus so it is not a security risk):
curl -H 'Date: Thu, 09 Oct 2014 16:56:21 +0000' -H 'Authorization: AWS Y29tZXQ=:ciitxdxRvWrlcVsc48JnXqKu/oY=' -L -H 'content-type: ' -T README.txt 'http://localhost:1301/s3/README.txt?format=xml' -k
The
base.Request.Files
API is only for handling HTTPmultipart/form-data
file uploads.To handle other File Uploads you can decorate your Request DTO with
IRequiresRequestStream
which tells ServiceStack to skip deserialization and inject the Raw InputStream into your DTO instead:In your Service you can handle
This feature is described in the Serialization/Deserialization wiki.