packages/@uppy/companion/src/server/controllers/s3.js
function abortMultipartUpload (req, res, next) {
    // @ts-ignore The `uppy` property is added by middleware before reaching here.
    const client = req.uppy.s3Client
    const { uploadId } = req.params
    const { key } = req.query

    if (typeof key !== 'string') {
      return res.status(400).json({ error: 's3: the object key must be passed as a query parameter. For example: "?key=abc.jpg"' })
    }

    client.abortMultipartUpload({
      Bucket: config.bucket,
      Key: key,
      UploadId: uploadId
    }, (err, data) => {
      if (err) {
        next(err)
        return
      }
      res.json({})
    })
  }
function abortMultipartUpload (req, res, next) {
    // @ts-ignore The `uppy` property is added by middleware before reaching here.
    const client = req.uppy.s3Client
    const { uploadId } = req.params
    const { key } = req.query

    if (typeof key !== 'string') {
      return res.status(400).json({ error: 's3: the object key must be passed as a query parameter. For example: "?key=abc.jpg"' })
    }

    client.abortMultipartUpload({
      Bucket: config.bucket,
      Key: key,
      UploadId: uploadId
    }, (err, data) => {
      if (err) {
        next(err)
        return
      }
      res.json({})
    })
  }
function abortMultipartUpload ( req , res , next ) { // @ts-ignore The `uppy` property is added by middleware before reaching here. const client = req . uppy . s3Client const { uploadId } = req . params const { key } = req . query if ( typeof key !== 'string' ) { return res . status ( 400 ) . json ( { error : 's3: the object key must be passed as a query parameter. For example: "?key=abc.jpg"' } ) } client . abortMultipartUpload ( { Bucket : config . bucket , Key : key , UploadId : uploadId } , ( err , data ) => { if ( err ) { next ( err ) return } res . json ( { } ) } ) }
Abort a multipart upload, deleting already uploaded parts.

Expected URL parameters:
- uploadId - The uploadId returned from `createMultipartUpload`.
Expected query parameters:
- key - The object key in the S3 bucket.
Response JSON:
Empty.
Abort a multipart upload deleting already uploaded parts .