Uploading File chooser form to derby or computer [message #1850389] |
Mon, 28 February 2022 23:18  |
Eclipse User |
|
|
|
I am new to eclipse scout and tried to follow different forum topics and posts about the file chooser option. I already have a derby database linked to my eclipse scout project and was wondering for files if i should upload them to my database with a BLOB type or if i should upload them to my computer and just reference the filename. Either way I am confused on the process on what to put in the newHandler class for uploading in the client. Also what to do on the server side and if anyone can start a discussion with me to help me learn and understand this process I would much appreciate it. I have created several forms already for simple strings and integers that upload to my database it is just files that are a new concept to me.
|
|
|
Re: Uploading File chooser form to derby or computer [message #1850635 is a reply to message #1850389] |
Fri, 11 March 2022 03:55   |
Eclipse User |
|
|
|
Hi Reese
You can use Scout in many different deployment scenarios. But the must typical is to use Scout (Classic) as a client/server application where the Scout UI and the Scout server run on a central server, which connects to a database. In that scenario I'd recommend to store an uploaded file as BLOB in the database. Another approach is to store the uploaded files in a dedicated, central file storage (like S3, etc.) and only store a reference (URL) to that file in your database. However, if you're just starting to learn Scout I'd go with the BLOB approach because it's easier to implement, since you already have a DB connection and you don't have to deal with issues that might come up when you must access another external system/component/api.
Btw: when you use Scout's file chooser, the resource is always uploaded to the UI server automatically. From there you'd pass the resource as BinaryResource to the Scout server and store it in your database. I don't understand your question about the "new handler" anyway: typically you use the "new handler" to create a new, empty entity (like a new "person" in a CRM application), in the new PersonForm you could enter the persons name and upload a photo of that person, which you would store in the execStore method of the handler. Maybe the same form has a "modify handler" which would load the data (including the photo) from the server and display all data in the PersonForm when it is opened.
Cheers
André
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04664 seconds