1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| protected void doGet(...){
....
pResponse.setCharacterEncoding("ISO-8859-1");
pResponse.setHeader("Content-disposition", "inline; filename=\"" + nomDocument + "\"");
//je doit passer par "inline" pour ouvrir word sans aucune alerte.
pResponse.setContentType("application/msword;name=" + pNewName);
try{
ServletOutputStream out = pResponse.getOutputStream();
FileInputStream in = new FileInputStream(pFile);
int i;
while ((i = in.read()) != -1){
out.write(i);
}
in.close();
out.close();
}catch (IOException e){
...
} |
Partager