I have a .zip file stored in my database in a BLOB field and I want my web site user to download this file when he/she clicks on a web page button. Here is what I do in my servlet: response.setContentType("application/octet-stream"); byte b = /*get the BLOB field from my database*/ OutputStream out = response.getOutputStream(); out.write(b); out.flush(); out.close(); When the user clicks on my web page button the above code is executed and my web browser prompts the user to download the file, but the dialog box displays the form action instead of the filename. The contents of the file are ok, but I want the user to be able to save the file with the same name as it is stored in the database. Can anyone help me with this? Att. Leonardo Penha P.S.: In my servlet I have the file name stored in a String variable.