ImportHelper select multiple files

Can you access which files you have selected in file browser using ImportHelper?
filepath return only last one selected.

I mean in something like that:

class ImportSomeData(Operator, ImportHelper):
    bl_idname = "import_test.some_data" 
    bl_label = "Import Some Data"

    def execute(self, context):
        return read_some_data(context, self.filepath)


def read_some_data(context, filepath):

    #I want to know what i selected there


You can store them in a collection property:


class ImportSomeData(Operator, ImportHelper):
    bl_idname = "import_test.some_data" 
    bl_label = "Import Some Data"

    files = CollectionProperty(name='File paths', type=bpy.types.OperatorFileListElement)

    def execute(self, context):
        for filepath in files:
            return read_some_data(context, filepath)


def read_some_data(context, filepath):

    #I want to know what i selected there

Thank you!

I used bpy.types.PropertyGroup with sucess, is there a benefit in using bpy.types.OperatorFileListElement instead?

I don’t know, I just never learned any other way to do it.