|
3#
楼主 |
发表于 2012-3-2 15:38:56
|
只看该作者
} catch (HttpException e) {
//
} catch (IOException e) {
//
} catch (Exception e) {
//
} finally {
openURLPost.releaseConnection(); //释放
loginPost.releaseConnection();
}
String filePath = "E:\\GE0223.mpeg"; //待$$$$$$的文件路径
String caseid = "23";
for (int i = 0; i < 1; i++) {
try {
Part[] parts = {new FilePart("filedata", new File(filePath)),
new StringPart("Filename", "GE0223.mpeg"),
new StringPart("name", "10001a.mpeg"),
new StringPart("modifyTime", "1301021316000"),
new StringPart("folderId",caseid),
new StringPart("vehicleTypeCode","小型汽车号牌")
}; //父单位ID
PostMethod filePost = new PostMethod("####################/file.go"); //构造请求
filePost.addRequestHeader("Cookie", sessionIDByPost); //为请求设置cookie
int respanceCode = 0;
try {
filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams()));
client.executeMethod(filePost);
} catch (HttpException e) {
//
} catch (IOException e) {
//
} catch (Exception e) {
//
} finally {
filePost.releaseConnection();
}
} catch (Exception e) {
//
}
} //for
return 0;
}//end of action
public int end() throws Throwable {
return 0;
}//end of end
} |
|