文件保存路径不正确; 3
* 没有设定正确的 enctype ;4 文件操作异常。
*/
public int process() {
int status = 0;
// 文件上传前,对 request 对象,上传路径以及 enctype 进行 check 。
status = preCheck();
// 出错的时候返回错误代码。
if (status != 0)
return status;
try {
// �� 参数或者文件名 �u��
String name = null;
// 参数的 value
String value = null;
// 读取的流是否为文件的标志位
boolean fileFlag = false;
// 要存储的文件。
File tmpFile = null;
// 上传的文件的名字
String fName = null;
FileOutputStream baos = null;
BufferedOutputStream bos = null;
// �� 存储参数的 Hashtable
paramHt = new Hashtable();
updFileArr = new ArrayList();
int rtnPos = 0;
byte[] buffs = new byte[BUFSIZE * 8];
// � 取得 ContentType
String contentType = request.getContentType();
int index = contentType.indexOf("boundary=");
String boundary = "--" + contentType.substring(index + 9);
评论0
最新资源