Multiple file upload

Multiple file upload

  

I would like to ask the best practice with multiple file upload. 

The scenario is I have a requirements list(predefined/populated in a table). Each requirement has a single document/binary data field where a user needs to attach a file. So per row there's a popup upload generated per requirement.

Now I have a save button, that will save all the documents to the Requirements Entity (with binary data field). How can I access each file upload widget generated per row to get the .content property?

*Note that, each file upload widget per row has same name but with different widget id at runtime.


Hello Arvin,

One possible solution is given here.

You need to have an input parameter in the popup screen of type YourEntity identifier.

You get this identifier from the line in the table records in the parent screen, something like "MyTableRecords.List.Current.MyEntity.Id".
This way you can relate the file to the correct record in the table.

As another point, put the file in a separate entity. It can be an extension entity if each record of the main entity can have a sinle file associated, like here: https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships/Create_a_One-to-One_Relationship

Now, the ID of the record in the FILES entity will be the same id of the associated entity record.

Cheers.

Eduardo Jauch wrote:

Hello Arvin,

One possible solution is given here.

You need to have an input parameter in the popup screen of type YourEntity identifier.

You get this identifier from the line in the table records in the parent screen, something like "MyTableRecords.List.Current.MyEntity.Id".
This way you can relate the file to the correct record in the table.

As another point, put the file in a separate entity. It can be an extension entity if each record of the main entity can have a sinle file associated, like here: https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships/Create_a_One-to-One_Relationship

Now, the ID of the record in the FILES entity will be the same id of the associated entity record.

Cheers.


Just for example, I attach file for the first requirement then after that I attach a file for the second one. Is there a way I could save the 1st file in a temporary container so after I clicked the save button. That's the only time all the files will be save to database?

Eduardo Jauch I forgot to tell you that I need to do it dynamically, Can you help me with this? :)