Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ class RichDocumentsEditorWebView : EditorWebView() {
val url = downloadJson.getString(URL).toUri()
when (downloadJson.getString(TYPE)) {
PRINT -> printFile(url)

SLIDESHOW -> showSlideShow(url)
else -> downloadFile(url, fileName)

else -> {
val downloadFileName = downloadJson.optString(FILENAME, fileName)
downloadFile(url, downloadFileName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for the PR.

I have a quick question regarding the fileName handling. Is the fileName always incorrect, or is it only missing the extension in some cases? Also, can we confirm whether downloadJson.optString(FILENAME, fileName) consistently returns valid data?

Could you please share the steps to reproduce the issue and how you tested this? That would help us better understand the scenario and verify the behavior on our side.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

fileName extension is incorrect when using "Download as" button to download file into different format. In Collabora Online side, I added CollaboraOnline/online#14344 filename property to the DownloadAs postmessage JSON which will filename with correct extension.

Steps to reproduce:

  1. Open writer document
  2. Hamburger Menu > Download as -> rtf
  3. File will have wrong extension on download

}
}
} catch (e: JSONException) {
Log_OC.e(this, "Failed to parse download json message: $e")
Expand Down Expand Up @@ -219,5 +224,6 @@ class RichDocumentsEditorWebView : EditorWebView() {
private const val PRINT = "print"
private const val SLIDESHOW = "slideshow"
private const val NEW_NAME = "NewName"
private const val FILENAME = "filename"
}
}