This is an automated email from the ASF dual-hosted git repository. solomax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/master by this push: new a75ef5c [OPENMEETINGS-2453] file is downloaded using it's UI name a75ef5c is described below commit a75ef5c50f2c2dcfbb556a767af1bb33b8fb1023 Author: Maxim Solodovnik <solomax...@gmail.com> AuthorDate: Fri Sep 25 18:47:36 2020 +0700 [OPENMEETINGS-2453] file is downloaded using it's UI name --- .../java/org/apache/openmeetings/web/common/tree/FileTreePanel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/tree/FileTreePanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/tree/FileTreePanel.java index 9dcce65..4b5f821 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/tree/FileTreePanel.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/tree/FileTreePanel.java @@ -44,6 +44,7 @@ import org.apache.openmeetings.db.entity.file.BaseFileItem; import org.apache.openmeetings.db.entity.file.BaseFileItem.Type; import org.apache.openmeetings.db.entity.file.FileItem; import org.apache.openmeetings.db.entity.record.Recording; +import org.apache.openmeetings.util.OmFileHelper; import org.apache.openmeetings.web.common.NameDialog; import org.apache.openmeetings.web.common.confirmation.ConfirmableAjaxBorder; import org.apache.openmeetings.web.common.confirmation.ConfirmationDialog; @@ -98,6 +99,7 @@ public abstract class FileTreePanel extends Panel { private BaseFileItem lastSelected = null; private Map<String, BaseFileItem> selected = new HashMap<>(); private File dwnldFile; + private String dwnldName; final AjaxDownloadBehavior downloader = new AjaxDownloadBehavior(new IResource() { private static final long serialVersionUID = 1L; @@ -110,6 +112,7 @@ public abstract class FileTreePanel extends Panel { protected ResourceResponse createResourceResponse(Attributes attr, Path path) { ResourceResponse response = super.createResourceResponse(attr, path); response.setCacheDuration(ZERO); + response.setFileName(dwnldName); return response; } }.respond(attributes); @@ -290,6 +293,7 @@ public abstract class FileTreePanel extends Panel { ? fi.getOriginal() : fi.getFile(ext); if (f != null && f.exists()) { dwnldFile = f; + dwnldName = fi.getName() + "." + OmFileHelper.getFileExt(f.getName()); downloader.initiate(target); } }