I am new to outsystems. I am doing a file uploading. How can I save the file? I read some notes regarding

the upload file system, it say to say the file in the screen action, use the Runtime Properties of the Upload Widget :

        Upload.Content, Unpload.Filename,Upload.Type

My question is How to use them? What is runtime properties?

Or can you teach me how to save a file in the upload widgets

Hi Theow,

Here is a success document from OutSystems on how to enable end users to upload files from either a mobile or web application.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Enable_End_Users_to_Upload_Files

Regards,

Daniel

Hi Theow,

You have to create database table with binary attribute for file and text attribute for file name. Then create a variable with this table data type and use Create action to save file in the database. 

Hi Theow,

Adding to the above comments. I created a small app.

Check this:  File Upload Demo App

PFA - includes the .oml solution file

Below mentioned are the available Upload Widget Run-time Properties to hold the run-time state of the widget.



For temporary storage you can define and use a Screen Local Variable of Binary Data type to hold the Upload Content Value.

In order to save the uploaded file content permanently you have to use database table for that as suggested by Daryana.


Hope this helps you!


Regards,

Benjith Sam

Is this error cause by I am a upload a file created by miscrosoft words instead of using binary file to upload.

Theow Meng Ang wrote:

Is this error cause by I am a upload a file created by miscrosoft words instead of using binary file to upload.

Hi Theow,


The error occurred because the Uploaded File Name Length was exceeding the actual entity attribute(FileName) Length value. Try to upload a file with short Length FileName.



Hope this helps you!


Regards,

Benjith Sam

Hi Theow,

Reason of this issue could be the length of the attributes of your File entity. Suppose if length of any attribute say filename is 50 but you are saving a name which has length of more then 50 then you will get this kind of error.

So debug you save action and see which attribute is causing this issue and update length based on that.

Will the name of the file change after I upload. Let say if the file I am going to upload is CV.words, after I upload will the name change or it just remain as CV.words. Sorry I ask this as I am quite new to OUtsystems

I am trying to upload a file created by microsoft. Just the name CV. Is there any way for me to load microsoft word documents. I try using notepads it work but not with microsoft words.

Solution

Word file should not be an issue.

Your error message clearly says "string or binary data would be truncted" which indicates that content you are trying to save in your entity attributes are larger then its defined size.

Also when you save the file as binary data in your database it will just store its binary data, you have to save its type, name etc in separate attributes of the entity (I have check in your oml that you already have these attributes). When you want to download you can use these attributes to give appropriate name and type to your file.

Solution

Thanks

Benjith Sam wrote:

Hi Theow,

Adding to the above comments. I created a small app.

Check this:  File Upload Demo App

PFA - includes the .oml solution file

Below mentioned are the available Upload Widget Run-time Properties to hold the run-time state of the widget.



For temporary storage you can define and use a Screen Local Variable of Binary Data type to hold the Upload Content Value.

In order to save the uploaded file content permanently you have to use database table for that as suggested by Daryana.


Hope this helps you!


Regards,

Benjith Sam

Hi Benjith,

I am new to outsystems and wanted to check this functionality.

However i am getting this error while publishing. Please help.

Publish aborted
New broken or missing references found for producer module 'UI_SampleApp'. Please review them and republish.

Hi Ravi,

You have added a depedency from module called UI_SampleApp. Possibly you have done some changes in that module but haven't refreshed depedency in this consumer module.

Here is the documentation link for you to understand how to manage change in the exposed functionality

https://success.outsystems.com/Documentation/11/Developing_an_Application/Reuse_and_Refactor/Handle_Changes_in_Exposed_Functionality

Hi Ravi Teja,

Sorry for the late reply. Actually, the shared .oml solution file is a consumer module which is referencing some of the UI elements from the same application producer module (which is missing in your environment) because of these very reason you are not able to publish the respective solution module.

Solution:

1) Create a new Web application i.e. Traditional web application

2) Create a module i.e. Traditional Web Type module

3) Copy the FileUploadDemo Screen, GetFileContentByFileId Server action and the File Entity from the shared .oml solution file and paste those objects to the newly created module (Point - 2)

4) Observe that whether the shared module is getting referred after pasting the objects in the newly created module, if so delete the referred module.

5) Publish the newly created module

PFA - includes the .oml solution file without any dependencies from the application producer modules.


Hope this helps you!


Regards,

Benjith Sam

Benjith Sam wrote:

Hi Ravi Teja,

Sorry for the late reply. Actually, the shared .oml solution file is a consumer module which is referencing some of the UI elements from the same application producer module (which is missing in your environment) because of these very reason you are not able to publish the respective solution module.

Solution:

1) Create a new Web application i.e. Traditional web application

2) Create a module i.e. Traditional Web Type module

3) Copy the FileUploadDemo Screen, GetFileContentByFileId Server action and the File Entity from the shared .oml solution file and paste those objects to the newly created module (Point - 2)

4) Observe that whether the shared module is getting referred after pasting the objects in the newly created module, if so delete the referred module.

5) Publish the newly created module

PFA - includes the .oml solution file without any dependencies from the application producer modules.


Hope this helps you!


Regards,

Benjith Sam

Thank you Benjith! I will try and work on this.


Ravi Teja wrote:

Thank you Benjith! I will try and work on this.

You're welcome, Ravi :)

Glad I could be of help!


Regards,

Benjith Sam