Custom module multi-upload

I have successfully implemented two file type fields in a basic type custom module.

The upload and deletion work well and if I click on the name of files, it downloads the respective documents.

The problem is if I try to click on the “eye” for the preview: this always has the first file as an entrypoint.

I followed these two guides: and

Thanks for support.

I don’t know what the exact issue is but i think you should try Field Collections created by pkonetskiy: