Custom (in-tree) upload provider in v4

System Information
  • Strapi Version: 4.1.9
  • Operating System: Windows
  • Database: postgres
  • Node Version: 16.15.0
  • NPM Version: 7.8.0

I’m trying to figure out how to add a custom upload provider in Strapi V4. I found this guide, which is fantastic except that it’s for V3 and doesn’t appear to work for v4. I’ve tried placing my code in both ./providers and ./src/providers (where . is the root of the Strapi project) and it doesn’t get picked up.

I’ve been able to get it working by setting the provider key in plugins.js to ../../../../../src/providers/myprovider (or something like that, I forget how many ../ repetitions it took) but that seems extremely fragile so I don’t consider it a long-term solution.

I could of course create an entirely separate project and pull it in via npm/yarn, but that seems like a lot of hassle for something that’s really very simple. Is there an official way of defining custom upload providers like there was in V3, or do I just have to hack it?

1 Like