-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
error when uploading/syncing a file with special characters #34600
Comments
I might have found a solution. But, you guys should verify this because I do not have full insight in the whole process: The destination file name of the MOVE request is also urlencoded in Files/Storage/DAV.php, where the renaming of the uploaded file is taken out in function "rename": Which creates such a request:
I removed the urlencoding of "$paht2" just to see what happens. The line now is: Which creates such a request:
And it works now. So obviously my conclusion was wrong because I supressed the urlencoding inside the "ecodePath" function in the first place. Thus, the uploaded part file couldn't be found anymore. Best regards, |
GitMate.io thinks the contributors most likely able to help are @ownclouders, and @PVince81. Possibly related issues are #26902 (error), #28840 (-Error-), #3088 (Special Characters error), #11681 (Errors when uploading to public folder), and #722 (file sharing error). |
@martink-p does the same thing happen on local storage? |
@individual-it I briefly reverted my change and checked it for local storage. It does not happen with local storage. But, I bet OC doesn't uses Files\Storage\DAV for local storage and there probably is no urlencoding in the chain.
To me it looks like a weird implementation on the server side now, as the urlencoded version of "May19#01.jpg" is correctly renamed on the remote end but not "Ä cookies 5%.txt". |
to check if its a problem on stratos side you can use an other webdav client to connect directly there or use curl to send MOVE commands to strato |
Hi. |
I'm wondering if that file name is urlencoded twice, since after the MOVE req the resulting file name is the urlencoded version of the original one... |
@individual-it can you confirm whether we have automated tests for such scenarios ? if we do then it would confirm that this is likely an env issue |
@PVince81 we do test funny char in filenames but we don't have tests with a WebDav storage and it looks to me that the code that deals with backend WebDAV storage is the problem |
Hey guys.
However, the following GET and PROPFIND requests fail with 404. The file on the remote has still an urlencoded name, but without the part-file extension (e.g. "%C3%84%20cookies%20%25.txt") Then I did exactly the same thing with the Windows WebDAV client. I've uploaded a file with that temporary part-file name of OC and tried to rename it to the target filename manually afterwards. Guess what... It fails as well! Sorry for providing misleading information. I would say this could only be a bug in Stratos WebDAV implementation, or not? If you agree I will file a bug to Strato. Best regards, |
For example:
And it works like a charme now. The filename is cleaned up from funny-chars first and then special chars are replaced by "-". Thus, you still have a somehow related filename for the part-file. But, I've noticed something else: |
By the sound of it that seems to be the core problem. To narrow it further down for Strato try to rename a file with funny char to a ASCII file name, my guess it that it also will fail
could you please open a separate issue for that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Hello ownCloud developers.
I've recently installed ownCloud with the latest available docker image, set it up and configured it to use an external storage (Strato HiDrive) with encryption enabled.
While synchronizing/uploading files I ran into a problem which I could not solve. However, I could at least isolate it.
Steps to reproduce
What I could isolate
Since that filename is obviousle urlencoded there must be some related code.
I could find it in OC\Files\Storage\DAV. That class has a function "encodePath" which is for example called from the function "rename". Within that function the filename is urlencoded and the callers probably don't notice this. I guess the remaining logic still look for the orignal name, while the file is moved and renamed on the remote storage using an urlencoded name. (The renaming is part of a call to moveFromStorage and the upload process, where the file is moved from some cache with using a ".part" upload file name to the target storage with a the "real" filename. Please don't blame me if this is not totally right, as the structure OC is really complex here.)
Simply removing the urlencoding does not work, maybe it breaks the DAV header.
Expected behaviour
The filename should match the orginal one, or at least the backend should map the name for the frontend if it really needs it encoded.
Actual behaviour
Error is reported and some backend process crashes becaus it cannot find the resource.
Server configuration
Operating system:
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Architecture: x86_64
Web server:
Latest Docker Image
Database:
Latest Docker Image
PHP version:
PHP 7.2.10-0ubuntu0.18.04.1
ownCloud version: (see ownCloud admin page)
10.0.10.4
Updated from an older ownCloud or fresh install:
Fresh Install
Where did you install ownCloud from:
Docker Image
Signing status (ownCloud 9.0 and above):
The content of config/config.php:
List of activated apps:
default plus encryption and ldap auth
Are you using external storage, if yes which one: local/smb/sftp/...
Yes. WebDAV, e.g. Strato HiDrive
Are you using encryption: yes/no
Yes
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Yes. Active Directory via LDAP
Logs
Web server error log
ownCloud log (data/owncloud.log)
The text was updated successfully, but these errors were encountered: