You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lauri Piispanen - Conmio Ltd <la...@conmio.com> on 2008/11/11 10:59:23 UTC
Issue with FileUpload.writeToTempFile()
Hi all,
I seem to be having a small portability glitch with
FileUpload.writeToTempFile(). Looking at the source code it seems to be
using item.getFieldName(), which on my page translates to
"filefields:1:upload". Windows doesn't really like colons, which gives
me the following stacktrace:
...snip until root cause...
Caused by: java.io.IOException: The parameter is incorrect
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1793)
at java.io.File.createTempFile(File.java:1830)
at
org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)
...snip...
On mac & linux this works just fine. I know that more elegant way would
be using the InputStream, but having a file is much more useful for
reading image dimensions and file length etc. than juggling things in
memory.
Sincerely,
--
Lauri Piispanen
Senior Product Architect
Conmio Ltd
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Issue with FileUpload.writeToTempFile()
Posted by Igor Vaynberg <ig...@gmail.com>.
please open a jira issue.
-igor
On Tue, Nov 11, 2008 at 1:59 AM, Lauri Piispanen - Conmio Ltd
<la...@conmio.com> wrote:
> Hi all,
>
> I seem to be having a small portability glitch with
> FileUpload.writeToTempFile(). Looking at the source code it seems to be
> using item.getFieldName(), which on my page translates to
> "filefields:1:upload". Windows doesn't really like colons, which gives me
> the following stacktrace:
>
> ...snip until root cause...
>
> Caused by: java.io.IOException: The parameter is incorrect
> at java.io.WinNTFileSystem.createFileExclusively(Native Method)
> at java.io.File.checkAndCreate(File.java:1704)
> at java.io.File.createTempFile(File.java:1793)
> at java.io.File.createTempFile(File.java:1830)
> at
> org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)
>
> ...snip...
>
> On mac & linux this works just fine. I know that more elegant way would be
> using the InputStream, but having a file is much more useful for reading
> image dimensions and file length etc. than juggling things in memory.
>
> Sincerely,
>
> --
> Lauri Piispanen
> Senior Product Architect
> Conmio Ltd
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org