java - how to store whole resume inside mysql database in servlet/jsp? -


resume uploading/downloading in java

i want store resumes inside mysql database , download in system. resume size upto 5 mb. how it??

currently i saved path in database , resume in folder.

refer servletfileupload() provided servlet technology, below piece of code demonstrating reading of file submited client.

 protected void dopost(httpservletrequest request, httpservletresponse response) throws  servletexception, ioexception {  try {     list<fileitem> items = new servletfileupload(new  diskfileitemfactory()).parserequest(request);      (fileitem item : items) {         if (item.isformfield()) {             // process regular form field (input type="text|radio|checkbox|etc", select, etc).             string fieldname = item.getfieldname();             string fieldvalue = item.getstring();             // ... (do job here)         } else {             // process form file field (input type="file").             string fieldname = item.getfieldname();             string filename = filenameutils.getname(item.getname());             inputstream filecontent = item.getinputstream();             // store file in mysql db          }      }   } catch (fileuploadexception e) {      throw new servletexception("cannot read file", e);   }     // ...   } 

servlet forefather of jsp, therefore can use same method in jsp also.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -