Re: how to upload a local file to web server?# Java - 爪哇娇娃
n*a
1 楼
I use the following code:
ServletInputStream in = request.getInputStream();
ByteArrayOutputStream bs= new ByteArrayOutputStream();
int c;
for (int i=0; i
bs.write(c);
}
All info about the uploaded file(s) (fileName(s), content
etc) are in this bs, just be careful when getting things
out. :-)