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? 回答1: No, its not the correct way.