1. Reliance
Apache httpclient Pack.
2. Code
HttpClient HttpClient =Newdefaulthttpclient (); HttpPost HttpPost=NewHttpPost ("Http://upload.eloancn.com/downLoadImg.action"); Stringbody FileName=NewStringbody (URL);//Picture path multipartentity reqentity=Newmultipartentity (); Reqentity.addpart ("Imgpath", fileName);//FileName File namehttppost.setentity (reqentity); HttpResponse Response=Httpclient.execute (HttpPost); intStatusCode =response.getstatusline (). Getstatuscode (); if(StatusCode = =HTTPSTATUS.SC_OK) {System.out.println ("Server normal response ..... Download complete. "); Httpentity resentity=response.getentity (); String Savepath= lei_fold+ "//" +dows[2].substring (Dows[2].lastindexof ("/") +1);//Picture save path FileOutputStream Fos=NewFileOutputStream (NewFile (Savepath)); Resentity.writeto (FOS); }
3. Parsing
See Source Notes
Java emulation downloads files from HTTP