Custom path upload to AWS

System Information
  • Strapi Version: 4.1.12
  • Operating System: Window
  • Database: MySQL
  • Node Version: 14
  • NPM Version: 6
  • Yarn Version: 3

Hi guys,
I want to custom path upload image to AWS like: banner to strapi-bucket/banner/banner.img or document to strapi-bucket/document/document.txt. But it seems like strapi does not support this yet.
Coul you guys give me any solution. Thanks for reading.

If you want to decide where to upload it, you can extend the plugin and do the logic there.
Depending on the type of file that gets uploaded you can set the path, and the plugin only selects the bucket so that should work.

1 Like

Thanks for your advice but i still not able to imagine how to extend plugin. I have tried to copy functions from aws-3-provider from node_module to controller and add custom path but its still not work. For more paticularly, could you show me examples of code. Many thanks

Copy the whole plugin, and make your own :slight_smile:

Clone it down make your own custom plugin out of it.

Thank you much <3

If this works feel free to mark it as a solution :slight_smile:
But glad to help

1 Like