| `bucket` | most similar to what most people think of as a "**folder**"<br>**MUST NOT** contain a slash `/` |
| `key`<br>("object key") | most similar to a "**file name**"<br>may contain "**/**"s as part of the name<br>**MUST NOT BEGIN** with a slash `/` |
| `prefix` | an informal term, refers to "**file path**"<br>what the AWS console uses for created virtual folder-like views and searches<br>**MUST END** with a slash `/` |
This library provides `prefix` (of `key`) for convenience.
`s3://bucket-name/long/prefix/data/stats.csv` can be represented equally well by any of the following:
(no prefix)
```json
{
"bucket": "bucket-name",
"prefix": "",
"key": "long/prefix/data/stats.csv"
}
```
(with long prefix)
```json
{
"bucket": "bucket-name",
"prefix": "long/prefix/data/",
"key": "stats.csv"
}
```
(with short prefix)
```json
{
"bucket": "bucket-name",
"prefix": "long/",
"key": "prefix/data/stats.csv"
}
```
### Troubleshooting
If the body is a stream then `size` must be set to `fs.statSync(filePath).size`, or the request will fail: