String fileHome = this.getServlet().getServletContext().getRealPath("/");
InputStream is;
FileOutputStream fileOut = new FileOutputStream(fileHome + "upload/receive/" + md.getId()+1 + ".zip");
URL url = new URL(md.getFromIp().replace("receive/onlineExport.do", "upload/receive/" + md.getId() + ".zip"));
URLConnection c = url.openConnection(); // *
c.connect();
is = c.getInputStream();
int data;
while ((data = is.read()) != -1) {
fileOut.write(data);
}
is.close();
fileOut.close();