Reputation: 215
I know how upload and save file. But how to upload the file without saving on disk and display text-data in TextArea or TextField.
Upvotes: 0
Views: 684
Reputation: 4754
When using the vaadin upload you should be able to use a ByteArrayOutputStream instead of a FileOutputStream.
So just use the sample from the book of vaadin but use a ByteArrayOuputStream instead.
When the uploadSucceeded method is called, you take the ByteArrayOutputStream, convert it into a string (Beware of the correct encoding) and set it as the value of your TextArea/Field.
Upvotes: 2