Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Upload to the correct path #745

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
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
49 changes: 0 additions & 49 deletions js/end_to_end_encryption-adminSettings.js.LICENSE.txt

This file was deleted.

4 changes: 2 additions & 2 deletions js/end_to_end_encryption-filedrop.js

Large diffs are not rendered by default.

174 changes: 0 additions & 174 deletions js/end_to_end_encryption-filedrop.js.LICENSE.txt

This file was deleted.

2 changes: 1 addition & 1 deletion js/end_to_end_encryption-filedrop.js.map

Large diffs are not rendered by default.

63 changes: 0 additions & 63 deletions js/end_to_end_encryption-settings.js.LICENSE.txt

This file was deleted.

3 changes: 2 additions & 1 deletion src/services/uploadFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import axios from '@nextcloud/axios'
import { getRootUrl } from '@nextcloud/router'
import path from 'path'

/**
* @param {string} davEndpoint
Expand All @@ -31,7 +32,7 @@ import { getRootUrl } from '@nextcloud/router'
*/
export async function uploadFile(davEndpoint, fileName, content, shareToken) {
await axios.put(
`${getRootUrl()}${davEndpoint}${fileName}`,
path.join(getRootUrl(), davEndpoint, fileName),
content,
{
headers: {
Expand Down
2 changes: 1 addition & 1 deletion src/views/FileDrop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default {
logger.debug(`[FileDrop] Filedrop entry computed: ${unencryptedFile.name}`, { fileDropEntry: progress.fileDrop[encryptedFileName] })

progress.step = UploadStep.UPLOADING
await uploadFile('/public.php/dav/', encryptedFileName, encryptedFileContent, this.shareToken)
await uploadFile(`/public.php/dav/files/${this.shareToken}`, encryptedFileName, encryptedFileContent, this.shareToken)
progress.step = UploadStep.UPLOADED
logger.debug(`[FileDrop] File uploaded: ${unencryptedFile.name}`, { encryptedFileContent, encryptionInfo, encryptedFileName, shareToken: this.shareToken })
} catch (exception) {
Expand Down
Loading