Hi,
you can model in the Data Model an attribute of type BLOB inside an Entity. In the Properties View of the attribute you can set a specific Upload Path. This means that when you upload a file, it will be saved in the folder "upload/images/photogallery". The upload folder is located by default inside the webapps folder of the Web application.
You can change this default and choose a folder outside the webapps one to store files. This can be done configuring the RTXConfig.properties file. This file can be accessed in this way:
- go to the WebRatio Explorer
- right click on the Web Project
- choose the option WebRatio -> Edit RTXConfig.properties
You have to change the uploadDirectory writing an absolute path and then the uploadDirectoryIsAbsolute setting it to "true". In this way you can store files in a specific folder on the file system of the server. For further information about the RTXConfig.properties file you can refer to this article on the WebRatio Official WIKI.
Finally, to change the name of the uploaded file with a custom one, you can model an Entry Unit having
two fields:
- one for the file to be uploaded (that will be a BLOB field)
- one for renaming the file (if you want the user to choose the new name)
Then, you place a Create Unit over the Entity containing the BLOB attribute. On the coupling of the link connecting the Entry Unit with the Create Unit you will find two couplings available for the BLOB attribute, one is the file itself, the other is the name to assign to the file once it's uploaded.