Processing multipart/form-data From Servlets


General J2EE: Processing multipart/form-data From Servlets

  1. Processing multipart/form-data From Servlets (2 messages)

    My requirement is i should get different data formats like "Resume","Pictures" ..which is through enctype:"multipart/form-data" may be from the File upload or using Textarea in client side form...How i should handle this in my servlets(Incoming Data) so that i can Process it .How can i process the information which i put up as a BLOB in MySql ,to get The BLOB data back to the user(Through servlet).
  2. Use the getReader from the ServletRequest object. The content is separated by a 'boundary'. The 'boundary' itself can be found as a header parameter which is available from the getHeader function (so you call getHeader("boundary") to get the value of the boundary). Now you can parse the reader to get the data between two separators and specifically get hold of the file data. This data is in Base64/UUENCODE (essentially both are the same) typcically. Now decode it and you have your data (text/binary alike). Regards, Rakesh.
  3. Thanks for The same[ Go to top ]

    I got the idea what u said.I tried succesfully implementing the concept using com.oreilly.servlet.MultipartRequest,written by Jason Hunter,Downloaded from oreilly website...Its have nice easy way to get the job done .now digging inside the classes and methods.. Thanks 4 helping out. regards kumaran