Uploads

Complete multipart upload

POST
https://discourse.example.com/uploads/complete-multipart.json

Completes the multipart upload in the external store, and copies the file from its temporary location to its final location in the store. All of the parts must have been uploaded to the external storage provider. An Upload record will be completed in most cases once the file is copied to its final location.

You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See:

https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.

An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function.

Body

application/json
unique_identifierstringrequired

The unique identifier returned in the original /create-multipart request.

Example
66e86218-80d9-4bda-b4d5-2b6def968705
partsarrayrequired

All of the part numbers and their corresponding ETags that have been uploaded must be provided.

Example
[
  {
    "part_number": 1,
    "etag": "0c376dcfcc2606f4335bbc732de93344"
  },
  {
    "part_number": 2,
    "etag": "09ert8cfcc2606f4335bbc732de91122"
  }
]

Response

200OKany

external upload initialized

Response fields application/json
idintegerrequired
urlstringrequired
original_filenamestringrequired
filesizeintegerrequired
widthintegerrequired
heightintegerrequired
thumbnail_widthintegerrequired
thumbnail_heightintegerrequired
extensionstringrequired
short_urlstringrequired
short_pathstringrequired
retain_hoursstring | nullrequired
human_filesizestringrequired
dominant_colorstring | null
thumbnailobject | null
Show child attributes
idinteger
upload_idinteger
urlstring
extensionstring
widthinteger
heightinteger
filesizeinteger
optimized_videoobject | null
Show child attributes
idinteger
upload_idinteger
urlstring
extensionstring
filesizeinteger
sha1string
original_filenamestring