javascript - Unable to read excel file using MultipartFormdataInput in Rest Call -
i using multipartformdatainput read excel file in rest call. server code mentioned below.
@post @path("/uploadedfile") @consumes("multipart/form-data") @produces({ "text/html" }) public /*jsonarray*/ string uploadedfile(multipartformdatainput input) throws exception { map<string, list<inputpart>> uploadform = input.getformdatamap(); list<inputpart> inputparts = uploadform.get("file"); system.out.println("in rest call file got" ); inputpart inputpart = inputparts.get(0); inputstream inputstream = inputpart.getbody(inputstream.class, null); xssfworkbook workbook = new xssfworkbook(inputstream); ..... }
now throw exception while reading inputstream? can tell me what's wrong in or there other way can totally new in area
exception is:
unable find messagebodyreader media type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet , class type java.io.fileinputstream
Comments
Post a Comment