This demo project shows basically the handling of a file upload. We asume, that the file is a .pdf file, so we can show it inside a XdevBrowserFrame.
- How to upload a file
- How to handle the file as stream
- Basic architecture
- How to add this ".pdf" to the XdevBrowserFrame
- Clone the GIT Reporsitory or use the import function of RapiClipse
- File -> Import -> RapidClipse -> Demo Projects -> "rapidclipse-demo-pdfupload"
- Maybe do some Maven updates to remove project errors
- Start the Project
- Choose a .pdf File to show it inside the XdebBrowserFrame or...
- Choose a different file for an instant download
Important is to realize how to process the file to its way to the browser.
- The file has to be chosen (Done by XdevUpload)
- The file must be sent to the server (Done by XdevUpload)
- There should be someone who waits for the file on server side and is ready to process the file (Done by the Receiver)
- The file has to be add to the XdevBrowserframe as StreamResource (Code inside the Receiver)
- The file has to be sent back to the client (Code inside the Receiver)
At the MainView you will see serveral UI Elements:
- XdevUpload
- XdevBrowserFrame
See the MainView Constructor for most of the Code.