Thank you both for your idea.

I checked in cluster the language settings using the command "locale".

> kubectl exec --stdin --tty wicket-app-76cf4b5b97-hrc62 -- bash
> srv:/foo> locale
> LANG=
> LANGUAGE=
> LC_CTYPE="POSIX"
> LC_NUMERIC="POSIX"
> LC_TIME="POSIX"
> LC_COLLATE="POSIX"
> LC_MONETARY="POSIX"
> LC_MESSAGES="POSIX"
> LC_PAPER="POSIX"
> LC_NAME="POSIX"
> LC_ADDRESS="POSIX"
> LC_TELEPHONE="POSIX"
> LC_MEASUREMENT="POSIX"
> LC_IDENTIFICATION="POSIX"
> LC_ALL=
> srv:/foo> locale -a
> C
> C.utf8
> POSIX
> en_US.utf8

While we use Springboot with CNB i had to add

> "BPE_LANG" : "C.UTF-8"

to my environment in bootBuildImage gradle task.
It seems to set UTF-8 as default to the JVM.
Now i can upload files with Umlauts and "strange" chars :-)

Hope this explanation helps others.

Regards
Per


> Gesendet: Mittwoch, 20. November 2024 um 13:29
&gt; Von: "Martin Grigorov" <mgrigo...@apache.org>
&gt; An: users@wicket.apache.org
&gt; Betreff: Re: UTF-8 Filename in FileUpload
&gt;
&gt; Hi,
&gt; 
&gt; Make sure that LC_ALL env var is set to some_lang.UTF-8 on your Linux
&gt; server.
&gt; 
&gt; On Wed, Nov 20, 2024 at 2:22 PM Per Newgro <per.new...@gmx.ch.invalid>
&gt; wrote:
&gt; 
&gt; &gt; Hi,
&gt; &gt;
&gt; &gt; i would like to upload a file that is named "Schmutzfänger Offroad 
hinten
&gt; &gt; 202443 und -444.JPG" in my local Windows Filesystem.
&gt; &gt; My app running in a cluster on a Linux image produces this exception.
&gt; &gt;
&gt; &gt; <pre>Unexpected error occurred
&gt; &gt; java.nio.file.InvalidPathException: Malformed input or input contains
&gt; &gt; unmappable characters: Schmutzfänger Offroad hinten 202443 und 
-444.JPG
&gt; &gt;     at java.base/sun.nio.fs.UnixPath.encode(Unknown Source)
&gt; &gt;     at java.base/sun.nio.fs.UnixPath.<init>(Unknown Source)
&gt; &gt;     at java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source)
&gt; &gt;     at java.base/java.nio.file.Path.of(Unknown Source)
&gt; &gt;     at java.base/java.nio.file.Paths.get(Unknown Source)
&gt; &gt;     at
&gt; &gt; 
org.apache.commons.fileupload2.core.DiskFileItem.checkFileName(DiskFileItem.java:165)
&gt; &gt;     at
&gt; &gt; 
org.apache.commons.fileupload2.core.FileItemInputImpl.getName(FileItemInputImpl.java:179)
&gt; &gt;     at
&gt; &gt; 
org.apache.commons.fileupload2.core.AbstractFileUpload.lambda$parseRequest$1(AbstractFileUpload.java:473)
&gt; &gt;     at org.apache.commons.io
&gt; &gt; .function.IOIterator.forEachRemaining(IOIterator.java:65)
&gt; &gt;     at
&gt; &gt; 
org.apache.commons.fileupload2.core.AbstractFileUpload.parseRequest(AbstractFileUpload.java:462)
&gt; &gt;     at
&gt; &gt; 
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl.parseFileParts(MultipartServletWebRequestImpl.java:189)
&gt; &gt;     at
&gt; &gt; 
org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1494)
&gt; &gt;     at
&gt; &gt; org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:812)
&gt; &gt;     at 
org.apache.wicket.markup.html.form.Form.onRequest(Form.java:760)
&gt; &gt;         [...]
&gt; &gt; </init></pre>
&gt; &gt;
&gt; &gt; Here is a small code snippet showing our current "setup"
&gt; &gt; <code>
&gt; &gt; MyPage() {
&gt; &gt;   Form&lt;&gt; form;
&gt; &gt;   add(form = new Form&lt;&gt;("form", model);
&gt; &gt;   form.setMultiPart(true);
&gt; &gt;   form.add(new FileUploadField("uploadMedium", PropertyModel.of(model,
&gt; &gt; "fileUpload"));
&gt; &gt; }
&gt; &gt; </code>
&gt; &gt;
&gt; &gt; When we commit the form, the exception is thrown.
&gt; &gt;
&gt; &gt; What is a good way to make file upload possible, with these type of
&gt; &gt; filenames?
&gt; &gt; Do i really have to overwrite FileUpload.getClientFileName? Maybe we 
can
&gt; &gt; setup
&gt; &gt; something completely different?
&gt; &gt;
&gt; &gt; Thanks for your support
&gt; &gt; Regards
&gt; &gt; Per
&gt; &gt;
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
&gt; &gt; For additional commands, e-mail: users-h...@wicket.apache.org
&gt; &gt;
&gt; &gt;
&gt; </per.new...@gmx.ch.invalid></mgrigo...@apache.org>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to