展开全部
jsp上传类
---------------------------
package com.modules;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FormData {
private String f_ex = "gif,bmp,jpg,png"; //允许上传文件类型,以逗号隔开,注意小写
private long f_max = 5000; //允许上传文件大小 kb
private String f_path = ""; //上传文件存入目录
private String f_url = ""; //上传文件返回URL路径
private String f_name = String.valueOf((new Date()).getTime()) +
String.valueOf(number(5)); //上传文件名字 f_name+_f_name _f_name+=1
private int _f_name = 0;
private String fileEx = ""; //扩展名
private String key_name; //hash-------key(key_name=表单元素file名)对应文件上传路径
private String path = "";
private String errcodes = "";
Hashtable hash = new Hashtable();
完整代码请参考下面代码
---------------------------
package com.modules;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FormData {
private String f_ex = "gif,bmp,jpg,png"; //允许上传文件类型,以逗号隔开,注意小写
private long f_max = 5000; //允许上传文件大小 kb
private String f_path = ""; //上传文件存入目录
private String f_url = ""; //上传文件返回URL路径
private String f_name = String.valueOf((new Date()).getTime()) +
String.valueOf(number(5)); //上传文件名字 f_name+_f_name _f_name+=1
private int _f_name = 0;
private String fileEx = ""; //扩展名
private String key_name; //hash-------key(key_name=表单元素file名)对应文件上传路径
private String path = "";
private String errcodes = "";
Hashtable hash = new Hashtable();
完整代码请参考下面代码
参考资料: http://www.xindaima.cn/new/h/47/2007-9/302.html
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询