iGuest 3 Report post Posted December 26, 2009 import com.Oreilly.Servlet.MultipartRequest;Import java.Io.*;Import java.Util.*;Import javax.Servlet.*;Import javax.Servlet.Http.*;public class UploadPhoto extends HttpServlet {Public void doPost(HttpServletRequest req, HttpServletResponse res) Throws ServletException , IOException {Res.SetContentType("text/html");PrintWriter out = res.GetWriter();String rtempfile = File.CreateTempFile("temp","1").GetParent();MultipartRequest multi = new MultipartRequest(req, rtempfile, 500 * 1024); File rnewfile=null;Rnewfile = new File(new File("/").GetAbsolutePath()+File.Separator+"tomcat"+File.Separator+"webapps"+File.Separator+"ROOT"+File.Separator+"Photo"+File.Separator+"YourPhotoname.Jpg");Out.Println("<HTML>");Out.Println("<head><title>UPLOAD PHOTO</title></head>");Out.Println("<body>");Out.Println("<Pre>");Enumeration files = multi.GetFileNames();While (files.HasMoreElements()) {File f = multi.GetFile(name);FileInputStream fin =new FileInputStream(f);ImageInfo ii =new ImageInfo();Ii.SetInput(fin);Fin.Close(); fin =new FileInputStream(f); FileOutPutStream fos =new FileOutPutStream(rnewfile); byte sizefile[] = new byte[500000]; fin.Read(sizefile); fin.Write(sizefile); fos.Close(); Fin.Close();F.Delete();}Res.SendRedirect("Your.Jsp");}} Share this post Link to post Share on other sites
iGuest 3 Report post Posted April 3, 2010 sending an image from client to clientUploading Image File Through JSP Code To Serveractually I m developing a chat server in java with the help of sockets but I am unable to send images from one client to other one.Please help me to provide this code as soon as possible. thank you in advance.-question by arya Share this post Link to post Share on other sites
iGuest 3 Report post Posted July 22, 2010 webservice from server to clientUploading Image File Through JSP Code To Serverhi I need to play a video saved on webserver which is requested by client to view in his mobile device how to write webservice for the above Any one pls help me out suggest me any solutions Thanx in advance ... Regards Nisha Share this post Link to post Share on other sites
iGuest 3 Report post Posted May 7, 2011 image is not shownUploading Image File Through JSP Code To ServerI had uploaded the picture and saved the path into database..But I am not able to retrieve the picture..Path is gettable but image is not shown..Below is the code..Do suggest some help.. -reply by R.A.Sethi Share this post Link to post Share on other sites