Extend Media Type

Hi to all.

Just wanted to ask (if anybody knows) if the Media Type is extendable?

I’m trying to figure this out because I would like to bind an additional key ( a sortId of kind ), so that I could track the sort order a user has setup to display images.

Any info would go a looong way.

Thanks.

This topic has been created from a Discord post (1293862373236670464) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

I achieved this through a custom upload provider:

upload: async (file, customConfig = {}) => {
  try {
    const image = await client.uploadFile(file.buffer, {
      fileName: file.name,
      contentType: getMimeType(file.name),
      baseCDN: baseCDN,
    })
  
    file.url = image.cdnUrl
  
    file.provider_metadata = {
      uuid: image.uuid,
      original_filename: image.originalFilename,
      image_info: image.imageInfo,
    }
    return file
  } catch (err) {
    if (err.message.includes('File size too large')) {
      throw strapi.errors.entityTooLarge()
    }
    throw strapi.errors.unknownError(`Error uploading to uploadcare: ${err.message}`)
  }
 },

Thanks for the reply - I totally missed that.

I see I have to re-implement the whole signature? Or can I provide the upload and it merges the default one with the extended upload?