Hello in this video I will show you how you can upload and they will load file into and from the file system. So in the database table in bill UI, let us add a new column called em. Doc we document and I will store the file name into this place so it will be worked off let us now create an EDF application PDF upload download application because because because it's rich New Business component it's a scenic design bid we you Okay, so this is our model. Let's create a new page. I will call this page employees which will have only one table which is employees Okay okay, this speech will have only one table the user will be able to upload the document and this document will be uploaded to a specific boss. So it has and that middle section and I will track that in between two to this as a tip okay so new fourth degree only single row and we don't need image is a prenup, which we created last video.
So it's okay we can see sample we took makitas Caesar for name Let's add input component to upload the document. So I will in the secondary toolbar let us add say to portlets add in portfolio to submit those estimates for it to be true and there's a very change to this notion. I will create a bean and add them all up EP muy bien. beam K and create input file component sorry Upload file. This is very change listener not binding. So let us select it again Upload file and in the advanced data point it binds the main component to receive the value after uploading.
So I will call this input file component and movies or tickets, we can What do you do? Have a comment. Okay so let's now and after we upload let us refresh the bulk collection finish everything here is a page. So as a partial trigger, let us select say input file. Okay, so this is what we do now what we did in the beach, we add the employee table input file and this input file has a value change listener to the bean. So let us now go to the bean here and we should write a code which will upload the file.
Okay, so this is my Upload File function here after it Upload is a file I will get is a traitor of the movie and I will set it in between doc with uploaded file name then I will commit it I will reset the value. So, actually this function Upload file to location will receive the file and it will generate a random name and it will upload the file to this specific post. So I create it here in the C for the whole upload through the file should be uploaded here. So I create this boss from C upload and this is a file name which I will generate automatically system to keep current loss I will add say upload the file name after the function will upload it it will retain the file name I will receive this file name and I will get the current throw of the control sample UI and they will sit in between talk with this file names in I will save I will reset the first component.
So let us now try to distance upload and see if it will work and the file will be uploaded and the invalid widow column will be updated or not to lick disassembly and upload one document and it was upload maybe this PDF file so uploading it now so it is uploaded here and this is the file name this is have a look in the folder it you'll find it is uploaded here. So this is selecting another image we select maybe image okay. So it is uploading the image now when it does open says you will find images uploaded here. So this is how you can upload stuff Fine. Just don't forget that when you execute a duration commit to add a commit or break into a page definition here, otherwise you'll get null pointer exception. So this is how you can upload the file.
Again, I received a file and sent it to this method. This method will take the file and upload it to the spouse and return the means of filename I will receive the file name and it gets the current troughs in between and sitting in between the document to this names in I will save the changes and reset the import file on board that's bad. Because the video I will show you how you can download this file. So see you in the activity.