diff --git a/changelog/unreleased/bugfix-download-files-special-chars b/changelog/unreleased/bugfix-download-files-special-chars new file mode 100644 index 00000000000..24342b97d8c --- /dev/null +++ b/changelog/unreleased/bugfix-download-files-special-chars @@ -0,0 +1,6 @@ +Bugfix: Download files with special chars in name + +We've fixed a bug where having a `#` in the filename resulted in requests going to cut off urls. + +https://github.com/owncloud/web/issues/10810 +https://github.com/owncloud/web/pull/10813 diff --git a/packages/web-pkg/src/composables/download/useDownloadFile.ts b/packages/web-pkg/src/composables/download/useDownloadFile.ts index fdaff1e2308..0bf8ab07cae 100644 --- a/packages/web-pkg/src/composables/download/useDownloadFile.ts +++ b/packages/web-pkg/src/composables/download/useDownloadFile.ts @@ -2,11 +2,12 @@ import { unref } from 'vue' import { usePublicLinkContext } from '../authContext' import { useClientService } from '../clientService' import { useStore } from '../store' -import { triggerDownloadWithFilename } from '../../../src/helpers' +import { triggerDownloadWithFilename } from '../../helpers' import { useGettext } from 'vue3-gettext' import { useCapabilityCoreSupportUrlSigning } from '../capability' import { Store } from 'vuex' import { ClientService } from '../../services' +import { encodePath } from '../../utils' export interface DownloadFileOptions { store?: Store<any> @@ -42,7 +43,7 @@ export const useDownloadFile = (options?: DownloadFileOptions) => { // construct the download url const url = version === null - ? `${client.helpers._davPath}${file.webDavPath}` + ? `${client.helpers._davPath}${encodePath(file.webDavPath)}` : client.fileVersions.getFileVersionUrl(file.fileId, version) // download with signing enabled