FileUpload#writeTo copies the stream / a possible rename would be faster
------------------------------------------------------------------------

                 Key: WICKET-2833
                 URL: https://issues.apache.org/jira/browse/WICKET-2833
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.4.7
            Reporter: Sebastian Hinzelmann


I used a FileUploadField as described in the wicket-examples 
(http://www.wicket-library.com/wicket-examples/upload/single) in my 
webapplication, in order to realise uploading a file and store this on the 
server. 
Furthermore I use the method FileUpload#writeTo(File file). This method is not 
the fastest solution, if you want to store the file, i think. Why don't you try 
to rename the file on the system first, before you use Streams.copy.
There is the interface FileItem. The method FileItem#write(File file) first 
tries to rename the file. I recognized a great benefit in performance.
Thats why i don't use the class FileUpload anymore, and receive such a FileItem 
from the request instead, like:
final FileItem item = ((IMultipartWebRequest) 
getRequest()).getFile(fileUploadField.getInputName()); 
item.write(....


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to