fixed 'FileUploadException Stream ended unexpectedly'

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5044 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
danielr 17 years ago
parent 8422ee5ec4
commit bb6a6fc233

@ -873,7 +873,8 @@ public final class httpd implements serverHandler, Cloneable {
*
* @author danielr
* @since 07.08.2008
* @param header hier muss ARGC gesetzt werden!
* @param header
* hier muss ARGC gesetzt werden!
* @param args
* @param in
* @param length
@ -881,13 +882,19 @@ public final class httpd implements serverHandler, Cloneable {
* @throws IOException
*/
@SuppressWarnings("unchecked")
public static HashMap<String, byte[]> parseMultipart(final httpHeader header, final serverObjects args, final InputStream in, final int length) throws IOException {
RequestContext request = new yacyContextRequest(header, in);
public static HashMap<String, byte[]> parseMultipart(final httpHeader header, final serverObjects args, final InputStream in, final int length)
throws IOException {
// read all data from network in memory
byte[] buffer = serverFileUtils.read(in);
// parse data in memory
RequestContext request = new yacyContextRequest(header, new ByteArrayInputStream(buffer));
// check information
if (!FileUploadBase.isMultipartContent(request)) {
throw new IOException("the request is not a multipart-message!");
}
// format information for further usage
FileItemFactory factory = new DiskFileItemFactory();
FileUpload upload = new FileUpload(factory);
List<FileItem> items;

Loading…
Cancel
Save