> For the complete documentation index, see [llms.txt](https://brianbuccaneer.gitbook.io/bottlenose/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brianbuccaneer.gitbook.io/bottlenose/sources-and-sinks/rxs3/operators/upload.md).

# upload

## Description

Streams RxJS items into a multipart S3 upload. The input data can be any of these types:

* Buffer
* Blob
* String
* Typed Array&#x20;
* ReadableStream

### Basic Example

```javascript
import { from } from 'rxjs';
import { upload } from '@bottlenose/rxs3';

// create file chunks to upload
const csvRow$ = from([
  'Name,Occupation\n',
  'Blackbeard,Pirate\n',
  'Captain Hook,Pirate\n',
  'Aladdin,Thief\n',
]);

// describe calculations
const upload$ = csvRow$.pipe(
  upload({
    s3Bucket: 'mys3bucket', 
    s3Key: './scurvy-dogs.csv',
    contentType: 'text/csv',
  })
);

// run the pipeline and do something with the results
upload$.subscribe(null, null, () => console.log('done'));
// done!
```

## API

```
upload({
  s3Key<String>,
  s3Bucket<String>,
  contentType<String>,
  [s3<AWS.S3>]
})
```

### Since

0.1

### Parameters

* `s3Bucket<String>`: The s3Bucket to which the file will be uploaded.
* `s3Key<String>`: The s3Key at which to store the file.
* `contentType<String>`: The content (MIME) type of the file.

### Options

* `s3<AWS.S3>`. An S3 client to use. Otherwise, one will be created by calling `new AWS.S3()`.

### Returns

`AWS.Response`. (The AWS Responses.)
