Skip to content

fix(richdocuments): Use filename from DownloadAs postmessage for correct file extension#16623

Merged
alperozturk96 merged 1 commit into
nextcloud:masterfrom
Rash419:fix-downlaod-as
Mar 9, 2026
Merged

fix(richdocuments): Use filename from DownloadAs postmessage for correct file extension#16623
alperozturk96 merged 1 commit into
nextcloud:masterfrom
Rash419:fix-downlaod-as

Conversation

@Rash419

@Rash419 Rash419 commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🏁 Checklist

  • Tests written, or not not needed


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

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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

…ect file extension

Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>

@alperozturk96 alperozturk96 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tested working, thank you.

However fallback fileName been used thus while downloading title ends with original file extension (e.g. my_doc.odt) and also downloaded file ends with original extension + wanted extension e.g (my_doc.odt.rtf)

Related part:

val downloadFileName = downloadJson.optString(FILENAME, fileName)

but we can handle these things in different PR.

@alperozturk96 alperozturk96 merged commit b9f39e5 into nextcloud:master Mar 9, 2026
5 checks passed
@alperozturk96 alperozturk96 added this to the Nextcloud App 33.1.0 milestone Mar 9, 2026
@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants