Skip to content

fix(dav): allow uploading of files with long filenames - #51491

Merged
susnux merged 2 commits into
masterfrom
fix/path-length
Apr 22, 2025
Merged

fix(dav): allow uploading of files with long filenames#51491
susnux merged 2 commits into
masterfrom
fix/path-length

Conversation

@susnux

@susnuxsusnux commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

Summary

A filename must be less or equal 255 characters, but when adding the
.part and .ocfiletransfer extensions we might overflow this limit.
So we should also use filename hashes for uploading when the file has a
long filename, similar like when we are uploading to the user storage directly.

TODO

  • discuss if it makes sense to align oc_filecache.name. Meaning to increase it from 250 to 255. cc @icewind1991

Tests

Before

Bildschirmfoto_20250315_135643

After

Bildschirmfoto_20250315_135602

Checklist

@susnuxsusnux added this to the Nextcloud 32 milestone Mar 14, 2025
@susnux
susnux marked this pull request as ready for review March 15, 2025 14:13
@susnux
susnux requested a review from a team as a code ownerMarch 15, 2025 14:13
@susnux
susnux requested review from icewind1991, provokateurin, skjnldsv and sorbaugh and removed request for a team and sorbaughMarch 15, 2025 14:13
@susnuxsusnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 15, 2025

@provokateurinprovokateurin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just one idea to make it even better.

Comment threadapps/dav/lib/Connector/Sabre/File.php Outdated
Comment threadbuild/integration/dav_features/dav-v2.feature
@susnux
susnux requested review from a team and provokateurinApril 18, 2025 22:44
Comment threadapps/dav/lib/Connector/Sabre/File.php Outdated
Comment threadapps/dav/lib/Connector/Sabre/File.php Outdated
Comment threadlib/private/Files/Type/Detection.php Outdated
Comment threadapps/dav/lib/Connector/Sabre/File.php Outdated
Comment threadbuild/integration/dav_features/dav-v2.feature
Comment threadapps/dav/lib/Connector/Sabre/File.php Outdated
Comment threadbuild/integration/dav_features/dav-v2.feature Outdated
Reduce nesting and drop duplicated sections.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
A filename must be less or equal 255 characters, but when adding the
`.part` and `.ocfiletransfer` extensions we might overflow this limit.
So we should also use filename hashes for uploading when the file has a
long filename, similar like when we are uploading to the user storage
directly.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux

Copy link
Copy Markdown
ContributorAuthor

rebased to squash fixup commits.

@susnux
susnux merged commit efa2cda into masterApr 22, 2025
@susnux
susnux deleted the fix/path-length branch April 22, 2025 11:53
@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable31

@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable30

Sign up for freeto 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.

Support correctly long path or filename failed to open stream: File name too long

4 participants

@susnux@skjnldsv@provokateurin@come-nc