As you say, the main thing is to develop a servlet to get the file and put it anywere in the server (filesystem, database, etc). Additionally you have to offer a servlet to return the file to the client to display it.
I would use gwtupload, which makes all the process pretty simpler. Take a look to the example in the gwtupload GettingStarted. It does almost everything you need except that it stores the file in a folder and maintain a list in memory to get a file given it's client id. The only thing you have to modify is the part where the servlet stores the file in a folder (executeAction
), and the part where the servlet returns the file to the client (getUploadedFile
), and change it to store/read the file into mysql.
Using gwtupload, you have other nice features like the ability to customize the FileUpload button, progress bar, multiple uploads etc.