0
다른 소프트웨어에서 HTTP-POST 요청을 통해 문서를 가져 오는 작은 파일 서버를 프로그래밍하고 있습니다.java.io.IOException : 내장 된 Jetty Server가있는 불완전한 부분
요청은 항상 "multipart/form-data"유형이므로, .getParts()를 통해 분할하려고합니다.
불행히도 "java.io.IOException : 불완전한 부품"이 있거나 부품을 찾지 못했습니다.
내 코드에 문제가 있습니까? 아니면 요청에 문제가 있습니까? MultiPartConfig는 송신의 본문
MultipartConfigElement multipartConfigElement = newMultipartConfigElement((String)null);
ir_request.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, multipartConfigElement);
시작하여
2017-11-28 11:07:47.941:INFO:oejs.Server:main: jetty-9.0.4.v20130625
2017-11-28 11:07:48.222:INFO:oejs.ServerConnector:main: [email protected]{HTTP/1.1}{0.0.0.0:1090}
Erkannte Aktion: CREATE_DOCUMENT
2017-11-2811:07:54.469:WARN:oejs.Request:qtp424058530-15:java.io.IOException:Incomplete parts
multipart/form-data; boundary=KoZIhvcNAQcB
1
null
행해졌 이클립스
가진 임베디드 부두 서버를 사용`난
public void create_document() {
String lv_path = gr_request.getParameter("contRep") + File.separator + gr_request.getParameter("docId");
Part lr_part = null;
try {
System.out.println(gr_request.getContentType());
//for testing
Part lr_test = gr_request.getPart("data");
System.out.println("1");
System.out.println(lr_test);
//the actual part
Collection<Part> lr_parts = gr_request.getParts();
for (Iterator<Part> i = lr_parts.iterator(); i.hasNext();) {
lr_part = ((Iterator<Part>) lr_parts).next();
//again for testing
System.out.println("content Type" + lr_part.getContentType());
System.out.println("name" + lr_part.getName());
System.out.println("content Type" + lr_part.getContentType());
String test = lv_path + ".jpg";
lr_part.write(test);
로그되고 PDF 파일 :
--KoZIhvcNAQcB
Content-Disposition: form-data; filename="data"
X-compId: data
Content-Type: application/pdf
Content-Length: 182370
%PDF-1.7
%µµµµ
1 0 obj
...and so on...
182188
%%EOF
--KoZIhvcNAQcB--