I want to stream multipart file directly to AWSS3 instead of saving file to disk at first. Receiving file of type \*multipart.FileHeader in my golang REST API. Now I want to stream this to AWSS3, using [s3manager](https://godoc.org/github.com/aws/aws-sdk-go/service/s3/s3manager) upload method where it's required to pass \*bytes.Reader in body param. I have seen an example of [uploading file to AWSS3](https://www.nicolasmerouze.com/file-upload-web-service-golang-s3-aws/), written in a way that opening a file **os.Open("filepath")** of type \*os.File from disk,getting \*bytes.Reader out of it and passing to AWSS3. Now I am struggling to convert this \*multipart.FileHeader to \*os.File.
['https://Stackoverflow.com/questions/40956103', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943467/']
Call [Open](https://golang.org/pkg/mime/multipart/#FileHeader.Open) on the `multipart.FileHeader`. It will return a `multipart.File` which will provide a reader to the file (which will be held in memory).
If you have multipart.File, then you can use next solution:

```golang
file, ok := multipartFile.(*os.File)
if !ok {
    responseError(w, errors.New("invalid file", errors.InvalidArguments))
    return
}

```