How to move Primefaces-Upload-Temp-Files instead of a time intensive copy
process?
I want to upload files larger than 2 GB with Java EE with the use of
primefaces. In general that it's not that big deal, but I have a little
problem. The usually way with PrimeFaces is to upload a file, have that
UploadedFile-Object, obtain the InputStream from that and then write it to
disk.
But writing to disk large files is a time intensive task. Instead I would
like to find the uploaded file in the file system and then move it to the
folder, where I store all the files, because moving files is not wasting
time.
So, according to this question here I figured out to set
PrimeFaces-Tmp-folder and the size-limit, when files will put there. Now
every uploaded file just goes directly into that folder. The point is,
that I now have a file on disk, while the user is uploading - and not
creating it afterwards.
So far, so good. I could identify the file and just move it (although it
has a strange name). But pointing to Primefaces Userguide (Page 187), this
Tmp-Folder is just used internally. And I even would steal the contents of
the UploadedFile-Object from Primefaces. Seems not to be a clean solution
to me.
Any hints how to achieve this ?
I also saw this question. Could also be my title, but it's not what I am
looking for.
No comments:
Post a Comment