Hi guys,


I'm very new to outsystems development.

I developing a web application with a form for user to fill in their fields and a popup for user to upload their files.

Let's say there are 3 upload file widgets on the popup with individual upload button for each file upload.

I have look at multiple forge components which doesn't fit my requirements.

I have tried putting them in a fileupload form but always uploaded one file instead of 3 files.

May I know how to assign the binaries content,name and file type in the preparation for 3 upload widgets into a single record? 

Regards,

Wen Kai


This doesnot fit your requirements:

https://www.outsystems.com/forge/component-overview/200/multiple-file-upload


Its the component is use when i need to upload multiple files. 

Hi Stefano Valente,


Thanks for your reply,i running on cloud environment.

I not sure how to use it. I only have fileupload dependencies which cannot work for some reason.


Hi TUNA.COM,

Thanks for your reply.

De 2nd file replace the 1st file when uploading.

I want to save it to a single record in another entity


Best Regards,

Wen Kai

Hi Wen,


First, welcome to the OutSystems world.


I would like you to explain to me a little better and in detail what you want to do, what is your need, to better understand !?


As I understand it, you want to build a popup where you can insert 3 files. But then I didn't understand what you want, nor what your problem is.


Just to be aware of another point, by good practice, you should keep the popups as absent from logic.

Best regards,

Nuno Miguel Verdasca

Nuno Miguel Verdasca wrote:

Hi Wen,


First, welcome to the OutSystems world.


I would like you to explain to me a little better and in detail what you want to do, what is your need, to better understand !?


As I understand it, you want to build a popup where you can insert 3 files. But then I didn't understand what you want, nor what your problem is.


Just to be aware of another point, by good practice, you should keep the popups as absent from logic.

Best regards,

Nuno Miguel Verdasca

Hi Nuno Miguel Verdasca,

Thanks for the welcome!:)


I am able to upload 3 files sucessfully when i press upload button.

What you mean by popups as absent from logic?

Sorry i do not understand what you mean by that.


Cuz this form let's pretend it is belong to a bookstore.The popup will upload several documents for a particular book.

My main entity is book.

File uploaded is stored into FileUpload Entity with binary content,mime type and file name stored.

Due to the some requirements, need to store with the book entity when user want to see the book with files attached.


May i know how to reference the files uploaded to the Main entity Book?


Best Regards,

Wen Kai





https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Implementing_Logic/Web_Logic_Tools/Download

https://www.outsystems.com/forums/discussion/39262/click-download-file-by-download-widget-but-no-file-extension/

Hi TUNA.COM,


Thanks for the links.

I am able to upload files to the fileuploaded entity i have shown in my previous post.

My diagram is uncomplete but i am able to upload 3 files through the diagram


This form belong to a bookstore.The popup will upload several documents for a particular book.

My main entity is book.

File uploaded is stored into FileUpload Entity with binary content,mime type and file name stored.

Due to the some requirements, need to store with the book entity when user want to see the book with files attached.


May i know how to reference the files uploaded to the Main entity Book?


Best Regards,

Wen Kai



GIven the ID of Main Entity Book record, you can drag aggregate and filter it by ID.

Put the binary content to this widget:

Solution

Hi,

The FileUpload entity needs to have a foreign key which is the BookId. On those assigns you do before creating the FileUpload you need to assign those foreign keys. This way when you are on book detail you can include a list of files that are linked to the Book by getting all the FileUpload that have as foreign key the same BookId as the one you are showing the detail.

Regards,

Marcelo

Solution

Hi Marcelo Ferreira,


i understand.

Thanks for explaning to me very clearly.


I got another question.May i know what way should i store the files temporarily?

For example, the user close the popup or navigate to another page or choose file and never upload.


From what i know, i think there is 2 ways to store

1) Store files into temporary variables and assigning each file before uploading each individual file.

2) Store the files into a temporary table before uploading.


May i know what is the recommended way to store the files before uploading to the fileuploaded table?


Best Regards,

Wen Kai




Hi,

Till someone upload the file, the user or the system, the file will only exist on client side. After the upload, since the server transaction finish and there is not place to save the document in a variable there, you can save it on a temporary entity or send it back to the screen using viewstate or session. You can even save the file in a JS variable before the upload but the question is why you want to do that?

Can you explain better what you are trying to accomplish?

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi,

Till someone upload the file, the user or the system, the file will only exist on client side. After the upload, since the server transaction finish and there is not place to save the document in a variable there, you can save it on a temporary entity or send it back to the screen using viewstate or session. You can even save the file in a JS variable before the upload but the question is why you want to do that?

Can you explain better what you are trying to accomplish?

Regards,

Marcelo

Hi,


My requirements need the user to fill in a form and upload files anytime to complete the form before submitting.

Once the user fill in all the required fields,form can be submitted. I not sure how the user will complete the form.

There is a form and 2 popup on the webscreen. The user can fill some sections of the form and finish later when they are free.


I mean the variable to store the files temporarily before uploading.


Thank you.


Best Regards,

Wen Kai



# just save to true entity - return the ID

# no need to save temporary

# when the user add another fields, just update the record with that ID

Hi TUNA.COM,


Sorry that i never explained carefully. 

I want to update that file which the user is uploaded temporary to the user before the user check is the correct file for uploading.

To show the user that he uploaded correctly.

I not sure to show him the temporary file from the temporary table through expression or an action or through a link to see that file the user have uploaded.



Thank you.

Best Regards,

Wen Kai




hi,

it is always better to put your data in database, either temporarily or permanently.

just do delete or give flag if it is not used.

regards

TUNA.COM wrote:

hi,

it is always better to put your data in database, either temporarily or permanently.

just do delete or give flag if it is not used.

regards

Hi TUNA.COM,

Thanks for the tip.

Maybe i set a timer to delete the files for the user if they have not upload any files

Give flag what does it mean?


Regards,

Wen Kai


Hello wen, 

Could I give you a little advice on how to ask questions? 

Forum is a place not only to receive help, but to give it as well. And one way of helping is through structured questions. 

So , the ideal is to keep a single question per Post. 

After someone give you the solution for your original post, mark it, or if you found it alone, put the solution and mark it. 

If you still have questions related to the original one, it's OK, but if the questions start to drift away, like it happens here, my suggestion is to create a new topic with the new question and put a reference to the original one. 

This way questions remain separate and is easier for everybody to find questions and solutions. 

Cheers 

P. S do not forget to mark the solution for your original question. 

Eduardo Jauch wrote:

Hello wen, 

Could I give you a little advice on how to ask questions? 

Forum is a place not only to receive help, but to give it as well. And one way of helping is through structured questions. 

So , the ideal is to keep a single question per Post. 

After someone give you the solution for your original post, mark it, or if you found it alone, put the solution and mark it. 

If you still have questions related to the original one, it's OK, but if the questions start to drift away, like it happens here, my suggestion is to create a new topic with the new question and put a reference to the original one. 

This way questions remain separate and is easier for everybody to find questions and solutions. 

Cheers 

P. S do not forget to mark the solution for your original question. 

Hi Eduardo Jauch and everyone,


Thanks for the advice and help given by you guys.


I try to ask keep my questions separated in the future. 


Thanks again!


Best Regards,

Wen Kai