Copy files with media API

System Information
  • Strapi Version: 4.9.1
  • Operating System: Windows
  • Database: sqlite
  • Node Version: 16.15.0
  • NPM Version: -
  • Yarn Version: 1.22.19

Hey guys!
So in our project we use Strapi for our back-end and we have our image (or video) files stored in upload service (media library as it’s shown on the UI). And now we’ve implemented new feature when certain thing happens we need to get copy of that file (basically duplicate it)
It’s easy with entities from content management, we just grab the entity, update necessary fields and create new one, but with this media API is a bit tough. Would appreciate any advice

For example: we have the following code part
const uploadService =;
we take upload service and use it, it has following methods
{ emitEvent, formatFileInfo, enhanceAndValidateFile, enhanceFile, upload, uploadImage, uploadFileAndPersist,
updateFileInfo, replace, update, add, findOne, findMany, findPage, remove, uploadToEntity, getSettings, setSettings, getConfiguration, setConfiguration }
We have used update or findOne for example, but I can’t find anything related to copying

I don’t know of any copy functions off the top of my head but you could copy the image using Node and upload a new version into the media library.