Multipart request with tempFile

5 views
Skip to first unread message

László Tóth

unread,
May 11, 2025, 3:47:17 PMMay 11
to Undertow Dev
Hi!

If I post a bigger Suneditor created doc value, than undertow save it to temp file. (Another problem, we want this file encrypt, perhaps can I make a PR for this?)...

If I have non-english characters in file than the reader can cut one character into two part and then concatenates this two part character into two character.

public static String readFile(InputStream file, Charset charSet) { 
  try (BufferedInputStream stream = new BufferedInputStream(file)) { 
    byte[] buff = new byte[1024]; 
    StringBuilder builder = new StringBuilder(); 
    int read; 
    while ((read = stream.read(buff)) != -1) { 
      builder.append(new String(buff, 0, read, charSet)); 
    } 
    return builder.toString(); 
  } catch (IOException e) { 
    throw new RuntimeException(e);
  } 
}

It think it is a bug. But perhaps I use this feature bad. I can parhaps increase multipart treshold, but i think it is not the good way...

H.
Reply all
Reply to author
Forward
0 new messages