你要是有用struts的话,直接定义private File detid;//获取文件
private String detidFileName;//获取文件名称
如果你直接用servlet的话可能会麻烦点,网上搜下很多!