Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Errors in the file manager when there are spaces in the path

    Support
    2
    3
    150
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mehdi
      mehdi App Dev last edited by

      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 %20s, 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)

      nebulon 1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff @mehdi last edited by

        @mehdi good catch. I can confirm and reproduce this. Working on a fix.

        1 Reply Last reply Reply Quote 1
        • nebulon
          nebulon Staff last edited by

          This is fixed with https://git.cloudron.io/cloudron/dashboard/-/commit/99f096c9711528406144e0245f8020c502d6490a and will be part of 6.2 then

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Powered by NodeBB