File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/java/CdbWebPortal/src/java/gov/anl/aps/cdb/portal/model/jsf/beans Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ public void upload(UploadedFile uploadedFile) {
5050 Path uploadDirPath ;
5151 try {
5252 if (uploadedFile != null && !uploadedFile .getFileName ().isEmpty ()) {
53- String uploadedExtension = FileUtility .getFileExtension (uploadedFile .getFileName ());
53+ String fileName = uploadedFile .getFileName ();
54+ String uploadedExtension = FileUtility .getFileExtension (fileName );
5455
5556 uploadDirPath = Paths .get (StorageUtility .getFileSystemLogAttachmentsDirectory ());
5657 logger .debug ("Using log attachments directory: " + uploadDirPath .toString ());
@@ -66,13 +67,14 @@ public void upload(UploadedFile uploadedFile) {
6667 logger .debug ("Saved file: " + originalFile .toPath ());
6768 Attachment attachment = new Attachment ();
6869 attachment .setName (originalFile .getName ());
70+ attachment .setOriginalFilename (fileName );
6971 List <Attachment > attachmentList = logEntry .getAttachmentList ();
7072 if (attachmentList == null ) {
7173 attachmentList = new ArrayList <>();
7274 logEntry .setAttachmentList (attachmentList );
7375 }
7476 attachmentList .add (attachment );
75- SessionUtility .addInfoMessage ("Success" , "Uploaded file " + uploadedFile . getFileName () + "." );
77+ SessionUtility .addInfoMessage ("Success" , "Uploaded file " + fileName + "." );
7678 }
7779 } catch (IOException ex ) {
7880 logger .error (ex );
You can’t perform that action at this time.
0 commit comments