My first project was build directly with this forge component. Was able to upload the pdf, download and all.
First Project
Second ProjectFollowed the same settings and procedures I did for project except the entity and database is different.
Problem: Whenever I save the file, the binary data will be saved onto First Project (In MultipleUpload Entity.) So there is no files or data inside the 2nd project I created.
Is there a way where I can have different database to store their own respective PDF binary file? If it can be done, please share your guide with me... I tried using Multi Tenant application setting. Does not seems to work...
I just created a sample OML and using upload file component with Binary data
Then created two actions to handle component events
I also created one database entity to save uploaded file details and used its create action inside action of component "FileUpload_BinaryDataOnFileUpload"
Hi @José Pedro Proença and @Mostafa Othman, thank you so much for the clarification. Managed to figured it out. I was able to make a simple application just purely on my own database. And would say the tricky part is the temp folder. Was a bit confusing... but I am good now..So the temp File, is used for storing file temporarily (Front end where user can see visually the file name etc that was uploaded.) Has nothing to do with any entity.
Button to save will so called "Create" (transfer this temp file into the database entity in outsystem).Do take note that the Entity ID should always be in auto-number settings.
If auto number is set to off, there will be query error (One of my screenshot shown in my comment above) if you upload the second file. In short, you can only have one file at a time.
The attached OML is my completed sample PDF upload for future reference. Thanks.
Hi, I'm the owner of the component, and I think @Mostafa Othman explained it correctly :)
The version with the temporary table, to me, is not the preferred option. Although it is easy to bootstrap the implementation, you'll end up with a bit of scattered logic.
What I do in my projects is use the binary data version of the component and then create an extension table (a table with just the binary data and a Foreign Key of the table where the rest of the data is stored, eg. "User" and "UserProfileImage") and simply call the "CreateOrUpdate" action of the extension table when the user clicks Save, to store the binary data of the file in the table.
This way you have complete control over the files, where they are stored and when they are deleted.
Hope this helps
Hi Jose, thank you for explanation. I tried to create binary data version of the component and then create an extension table like what you have mentioned. But, I could not seems to get the binary file uploaded in the first place..
Wanted to achieve something like you mentioned. File when uploaded will be stored in a temp database. Upon clicked "save" it will be saved to another permanent data. I couldnt seem to be able to complete first step despite the example from othman... Attached OML is for your reference.
bump
Hello Chin,
This component has two options:
- First one save uploaded files directly to temp tables existing into component itself and returns Id of each saved file so that you can use this Id to retrieve file again from temp table and save it to your application table
Please note that there is a timer which you can configure to delete uploaded files from this temp table
- The second option will return binary data and details of file which will allow you to save that file to your tables directly without using component temp table
Hi @Mostafa Othman , thanks for the clarification. But I am not sure why my UI is different from yours.. I suppose the file upload with binaryData is the one in yellow? Because I have been using the red one, and all the other projects pdf are all stored in this database instead of their respective project database..
I think you are not using latest version.
These are UIFlow of latest version that I am currently using
Have updated and followed his youtube tutorial but do not understand. I would like to enable users to upload PDF. And this PDF can be viewed and download by other users.. I can't seems to find an Entity in that video which stores the binary data.
Referring to this multi upload video ( multiple uploads with temporary data), which is way easier to be implemented but the table is temporary as shown in your comment above. so how do I transfer data out from the temp folder to my own project database? Or if I were to use the first method.. how do I retrieve the binary file from entity?
the video is incomplete as well... Video only showing uploading picture onto the site but not saving any data into the database.. Even one of the user commented...
Hi Othman, I tried your oml and it works. thanks... but I how can I make a saved button where user clicked save and it will be uploaded to a separate database?
Because the oml file u shared is an instant upload to database when the attached file. Here is my modified oml based on your example you shared.
unable to edit my reply.. But here is the Screenshot taken when I tired to upload the pdf file.
Sorry for late reply.
Kindly find your OML after applying some modifications
Hi @Mostafa Othman, thank, thank you for great help. I managed to figured it out some time back. but will look into your oml file as well. Greatly appreciated!