import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.myUpload.MyUpload;

public class ArgUploadServlet extends HttpServlet {
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		String contentType = request.getContentType();
		int bi = contentType.indexOf("boundary=");
		String boundary = contentType.substring(bi+9);
		
		MyUpload upload = new MyUpload();
		upload.upload(boundary, request.getInputStream(), "D:\\");
		String name = upload.getParameter("name1");
		
		PrintWriter out1 = response.getWriter();
		out1.println("Ok");
		out1.println("name = "+name);
	}
}