我从这里获取用户ID。
这是我设置内容配置标头的方式。
String struserid = tempdb.getuserid();
这是我设置内容配置标头的方式。
response.setHeader("Content-Disposition", "attachment; filename=sample.pdf");
这将提示下载名为“sample.pdf”的附件。但我需要文件名像“123456_sample.pdf”。
注意:123456是我从数据库中获取的值,它以字符串struserid的形式存储。
"attachment; filename=" + struserid + "_sample.pdf"
- Chris Haas