# Getting S3 Multipart Key in upload-success event

**URL:** <https://community.transloadit.com/t/getting-s3-multipart-key-in-upload-success-event/15350>\
**Category:** Uppy\
**Created:** [July 6, 2020, 9:03pm UTC](https://community.transloadit.com/t/getting-s3-multipart-key-in-upload-success-event/15350 "2020-07-06T21:03:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anark](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anark/32/257_2.png) [@anark](https://community.transloadit.com/u/anark)\
**Post date:** [July 6, 2020, 9:03pm UTC](https://community.transloadit.com/t/getting-s3-multipart-key-in-upload-success-event/15350/1 "2020-07-06T21:03:39Z")

</div>

Hello there,  
When using the aws-s3-multipart uploader with uppy I am unable to get the upload key in the upload-success event without calling Uppy.getFile.

For example I can get the key with the following(with a typescript error that s3Multipart does not exist even though does)

```
function uploadSuccess(file: UppyFile, response: any){
  uppy.getFile(file.id).s3Multipart.key,
}

```

But I cannot get it with

```
file.s3Multipart.key

```

As s3Multipart is not available on the passed in file.

Does anyone know of a better way to get the newly uploaded files key without typescript errors?

---

<div class="post-metadata">

**Author:** ![ajkachnic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/ajkachnic/32/260_2.png) [@ajkachnic](https://community.transloadit.com/u/ajkachnic)\
**Post date:** [July 8, 2020, 1:06pm UTC](https://community.transloadit.com/t/getting-s3-multipart-key-in-upload-success-event/15350/2 "2020-07-08T13:06:28Z")

</div>

I’m not sure if there is a better way to achieve this (I’ll keep looking), but the way I thought of is similar to this:

```auto
interface S3MultipartFile extends UppyFile {
  s3Multipart: {
    key: string;
  }
}
function uploadSuccess(file: UppyFile, response: any){
  (uppy.getFile(file.id) as S3MultipartFile).s3Multipart.key,
}

```

This uses [type assertions](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions). It’s worth noting that you could also use a type assertion `as any` or use `// @ts-ignore` instead. However, neither of these approaches yield the benefits of strong typing

If there are any additional properties that you’d need to access, you should be able to add them to the `S3MultipartFile` interface.

This should work. Let me know if you have any problems or further questions

- Andrew
