Fixed file upload

This commit is contained in:
Ziver Koc 2016-07-14 17:50:39 +02:00
parent 8ad285cd61
commit 99973b7c98
8 changed files with 61 additions and 51 deletions

View file

@ -72,20 +72,13 @@ public class MultipartParser implements Iterable<MultipartField>{
parseDelimiter(header.getHeader("Content-type")),
Long.parseLong(header.getHeader("Content-Length")));
}
/* public MultipartParser(HttpServletRequest req) throws IOException {
this(req.getInputStream(),
parseDelimiter(req.getHeader("Content-type")),
req.getContentLength());
}
*/
private static String parseDelimiter(String contentTypeHeader){
String delimiter = contentTypeHeader.split(" *; *")[1];
delimiter = delimiter.split(" *= *")[1];
return delimiter;
}
public long getContentLength(){
return contentLength;
}