我自己的简单方法:(很有效的) <% String fileName = new String(request.getParameter("upfile").getBytes("8859_1"));
int i=fileName.lastIndexOf("\\"); String fl=fileName.substring(i+1,fileName.length()); FileInputStream is = new FileInputStream(fileName); FileOutputStream os =new FileOutputStream(fl); int ch; while ((ch = is.read()) >= 0) os.write(ch); os.close(); is.close(); %>
<%
String fileName = new String(request.getParameter("upfile").getBytes("8859_1"));
int i=fileName.lastIndexOf("\\");
String fl=fileName.substring(i+1,fileName.length());
FileInputStream is = new FileInputStream(fileName);
FileOutputStream os =new FileOutputStream(fl);
int ch;
while ((ch = is.read()) >= 0)
os.write(ch); os.close();
is.close();
%>
hezhi007(key)的方法只适用于本机做服务器,自己传给自己,如果服务器在远程的话就不行了