Restricting file types upload component
I'm using the upload component of vaadin(7.1.9), now my trouble is that I'm not able to restrict what kind of files that can be sent with the upload component to the server, but I haven't found any API for that purpose. The only way is that of discarding file of wrong types after the upload. public OutputStream receiveUpload(String filename, String mimeType) { if(!checkIfAValidType(filename)){ upload.interruptUpload(); } return out; } Is this a correct way? No, its not the correct way. The fact is, Vaadin does provide many useful interfaces that you can use to monitor when the upload started,