package com.action; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionSupport; public class FileDownloadAction extends ActionSupport { /*private String fileName; public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getDownloadFileName(){ String name=getFileName(); try { URLEncoder.encode(name,"utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return name; }*/ public String getDownloadFileName(){ String name="朱艺璇。.txt"; try { name=URLEncoder.encode(name,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return name; } public InputStream getDownloadFile(){ return ServletActionContext.getServletContext().getResourceAsStream("file/朱艺璇。.txt"); } @Override public String execute() throws Exception { return SUCCESS; } }
最近下载更多
酒非儿 LV6
2021年12月3日
bcr1234 LV9
2020年8月6日
cz206616 LV10
2020年5月29日
王可以 LV10
2020年4月22日
oldtrybest LV8
2019年8月29日
11ccvvbb LV6
2019年4月10日
wdlsuper LV4
2019年1月24日
zzzxxx32 LV3
2019年1月8日
斤斤计较jh LV1
2018年12月9日
chengqiang LV13
2018年6月29日
最近浏览更多
lironggang LV38
2022年11月20日
uni-code_0123 LV1
2022年11月16日
雷迪斯俺的乡亲们 LV11
2022年3月9日
zhangmingzuidaima LV3
2021年12月16日
酒非儿 LV6
2021年12月3日
dongzhan LV12
2021年11月27日
sl0018 LV13
2021年10月3日
ALT_LB LV4
2021年8月23日
isMrQt LV1
2021年7月15日
MrQian LV1
2021年6月30日