better file extension

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1542153 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-11-15 01:38:43 +00:00
parent 86c913a95e
commit 34fd636ed8
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ public class DefaultFileUploadService
//Content-Disposition: form-data; name="files[]"; filename="org.apache.karaf.features.command-2.2.2.jar" //Content-Disposition: form-data; name="files[]"; filename="org.apache.karaf.features.command-2.2.2.jar"
String fileName = file.getContentDisposition().getParameter( "filename" ); String fileName = file.getContentDisposition().getParameter( "filename" );
File tmpFile = File.createTempFile( "upload-artifact", "tmp" ); File tmpFile = File.createTempFile( "upload-artifact", ".tmp" );
tmpFile.deleteOnExit(); tmpFile.deleteOnExit();
IOUtils.copy( file.getDataHandler().getInputStream(), new FileOutputStream( tmpFile ) ); IOUtils.copy( file.getDataHandler().getInputStream(), new FileOutputStream( tmpFile ) );
FileMetadata fileMetadata = new FileMetadata( fileName, tmpFile.length(), "theurl" ); FileMetadata fileMetadata = new FileMetadata( fileName, tmpFile.length(), "theurl" );