I want to upload the files into mysql database using jsp.When i use input type="file", jsp is not returning full path. i need full path to upload a file in mysql db.
<form id="translationFormID" method="post" action="saveTranslation">
<input type="file" name="attachCV" id="attachCVID" value="Attach CV">
<input type="submit" name="submit" />
</form>
This is my jsp page. i calling the servlet 'saveTranslation' using post method.
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String attachCV=null;
try{
String attachCV=request.getParameter("attachCV");
System.out.println("path= "+attachCV);
}
catch(Exception){
e.printStackTrace();
}
}
This is my servlet code. here getting and printing attachCV parameter. when i print the attachCV, its showing something like 'c:\fakepath\sample.docx'