Join GitHub today
Generic post method to actually allow uploading files #333
This PR adds support for uploading a file directly to the bucket via a multipart form post.
The createPresignedPost method is an AWS s3 method which creates a presigned url and fields which can be used for posting an s3 object directly to a private bucket
An example of calling this method:
which returns something like this:
Normally, you can just use the URL returned in the response in a multipart form and upload the file to the bucket. Currently, s3rver has no support for this upload method. This PR adds that support.
leontastic left a comment
@codyseibert Thanks for taking the time to add some tests! I have reviewed your PR, please take a look at my comments.
My biggest concern is the possibility of the actual file contents being uploaded in parts, overwriting each other at the same bucket + key. Write a test to prove that a large file upload doesn't get corrupted – if it passes then all is good, if it fails then you will need to rewrite this logic to concatenate file parts together.
Also, please run