JS中如何把上传的图片保存到指定文件目录
2013-08-29
展开全部
用JSPSMART处理,参考下面代码实现
<%
//程序初始化 下面设置成要保存的文件夹
String path_tmp = request.getRealPath("/") + "Upload";
String filename_p = "Test";
String path_new = request.getRealPath("/") + "Upload\\" + filename_p;
//文件上传
SmartUpload su = new SmartUpload();
su.initialize(pageContext);
su.upload();
int count = su.save(path_tmp);
//参数提取,后面贴不了,说我的重复内容多,这玩意真差...
%>
<%
//程序初始化 下面设置成要保存的文件夹
String path_tmp = request.getRealPath("/") + "Upload";
String filename_p = "Test";
String path_new = request.getRealPath("/") + "Upload\\" + filename_p;
//文件上传
SmartUpload su = new SmartUpload();
su.initialize(pageContext);
su.upload();
int count = su.save(path_tmp);
//参数提取,后面贴不了,说我的重复内容多,这玩意真差...
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询