Errors in the file manager when there are spaces in the path
-
I have errors in the file manager when trying to rename or move a file. I believe it happens when there are spaces in the full path. It seems that there's a mistake somewhere with the URL-encoding of the file paths, and the server responds with a 500 error.
In my case, it's for a Volume, but I guess it would be the same in the file manager of a normal app data.
Request:
PUT https://my.cloudron.url/api/v1/volumes/VOLUME_ID/files/directory%20with%20spaces/file.ext {"action":"rename","newFilePath":"directory%20with%20spaces/new subdirectory with spaces/filename.ext"}
Response :
500 { errno: -2, code: "ENOENT", syscall: "rename", path: "/app/data/VOLUME_ID/directory with spaces/filename.ext", dest: "/app/data/VOLUME_ID/directory%20with%20spaces/new subdirectory with spaces/filename.ext" }
I notice weird stuff with the spaces in the path. In the original path, it seems all spaces are actually spaces. But in the destination, up to the current directory it's with
%20
s, but the directory to which I'm trying to drag & drop my file correctly has spaces.(I have tried to anonymize some stuff in my logs, so I may have made mistakes, but I tried to keep it coherent with what I saw)