I am working with Vaadin and I want to upload an image from client's clipboard to the server.
I tried:
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
try {
BufferedImage image =
(BufferedImage)clipboard.getData(DataFlavor.imageFlavor);
}
catch(UnsupportedFlavorException ufe) {
ufe.printStackTrace();
}
catch(IOException ioe) {
ioe.printStackTrace();
}
However, this code only works in the local machine.
How can I allow users to upload their clipboard's image?