Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Uploading File chooser form to derby or computer(upload file to database or computer - preference)
Uploading File chooser form to derby or computer [message #1850389] Tue, 01 March 2022 04:18 Go to next message
reese houseknecht is currently offline reese houseknechtFriend
Messages: 1
Registered: March 2022
Junior Member
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 08:55 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
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é


Eclipse Scout Homepage | Documentation | GitHub
Re: Uploading File chooser form to derby or computer [message #1850942 is a reply to message #1850635] Wed, 23 March 2022 06:56 Go to previous messageGo to next message
ferdinand balbin is currently offline ferdinand balbinFriend
Messages: 1
Registered: March 2022
Junior Member
Hi. Good day. I just like to ask how can I get the source path of the file that is being uploaded using the AbstractFileChooserField? I've been searching everywhere and I cannot get an answer for this.
Re: Uploading File chooser form to derby or computer [message #1850946 is a reply to message #1850942] Wed, 23 March 2022 07:26 Go to previous message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Ferdinand

Since Eclipse Scout relies on the basics, the browser provides for file uploads, this is not possible because of security concerns. Check this discussion on SO: https://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav

Cheers
André


Eclipse Scout Homepage | Documentation | GitHub
Previous Topic:Calling a Scout Web Service from URL
Next Topic:Error deserialising blacklisted class `javax.management.Notification`
Goto Forum:
  


Current Time: Wed May 08 18:16:21 GMT 2024

Powered by FUDForum. Page generated in 0.02950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top