<%@ page import="java.i
utputStream,
java.io.File,
java.io.FileOutputStream"
%>
<%
String s = null;
int ai[] = new int[1];
byte[] Linebyte = new byte[4096];
ServletInputStream servletinputstream= request.getInputStream();
File file = new File("sss.xml");
FileOutputStream fileoutputstream = new FileOutputStream(file);
do
{
if(s != null)
{
fileoutputstream.write(Linebyte, 0, ai[0]);
fileoutputstream.flush();
}
ai[0] = servletinputstream.readLine(Linebyte, 0, Linebyte.length);
try
{
s = new String(Linebyte, 0, ai[0], "ISO-8859-1");
}
catch(Exception exception)
{
break;
}
long l = Long.parseLong(String.valueOf(s.length()));
servletinputstream.skip(l);
} while(true);
fileoutputstream.close();
处理xml文件
然后用out.println(...........)
来返回你的信息.........................
%>
delphi里
procedure TForm1.upfile;
var
Source : TMemoryStream;
Response : TStringStream;
begin
Response := TStringStream.Create('');
Memo1.Lines.Append(DateTimeToStr(Now())+':开始上传');
try
Source := TMemoryStream.Create;
try
Source.LoadFromFile(edtFilePath.Text);
idHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.Post(edtUrl2.Text, Source, Response);
finally
Source.Free;
end;
Memo1.Lines.Append(DateTimeToStr(Now())+':结束上传'+Trim(Response.DataString));
finally
Response.Free;
end;
end;