Upload multiples files to an entry after its creation (and how to add a caption ?)

Hey @thanneman
To answer your questions:

You don’t necessarily need a custom controller to add media files during entity creation. As long as you set the form data fields from the Strapi docs (being sure to start all of the file objects with ‘files.’ And specify the field that the belong to using the input field.

You are right that the code I showed was when adding media files to and existing entry. No need to specify these on creating a new entry.

Strapi does not automatically remove the media files associated with a content type record when the record is deleted. I created a util service (see below) that I call from a custom controller that overrides the default delete method and calls a util method to delete any related files

I too have created custom code (a util service, and custom plugin extension code for user registration) that handles several file upload challenges like:

Uploading images (like an Avatar) during user registration

Passing fileInfo information for any files

Deleting files when a content type that has associated media fields is deleted (No, Strapi doesn’t automatically do this)

The ability to update fileInfo fields for an existing media file (without have to re-upload the files).