(data io.Reader, bucket string, key string)
| 396 | } |
| 397 | |
| 398 | func (c *Client) UploadReaderToS3(data io.Reader, bucket string, key string) error { |
| 399 | _, err := c.S3Uploader().Upload(&s3manager.UploadInput{ |
| 400 | Bucket: aws.String(bucket), |
| 401 | Key: aws.String(key), |
| 402 | Body: data, |
| 403 | ACL: aws.String("private"), |
| 404 | ContentDisposition: aws.String("attachment"), |
| 405 | }) |
| 406 | |
| 407 | if err != nil { |
| 408 | return errors.Wrap(err, S3Path(bucket, key)) |
| 409 | } |
| 410 | |
| 411 | return nil |
| 412 | } |
| 413 | |
| 414 | func (c *Client) UploadFileToS3(path string, bucket string, key string) error { |
| 415 | file, err := files.Open(path) |
no test coverage detected