public class SampleServer2 extends HttpServlet {
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{
ServletInputStream in=request.getInputStream();
int length=ServletRequest.getContentLength();
ByteArrayInputStream din=new ByteArrayInputStream(in);
byte[]data=din.toByteArray();
din.close();// 还没用就close了?把这里注释掉。下面添加读操作
FileOutputStream fos=new FileOutputStream(toFile);
foswrite(Image[]);// Image[] 这是什么??
fos.close();
}