Rc via http: directory name with ampersand ("&")

What is the problem you are having with rclone?

vfs/refresh API call with a directory name that includes ampersand ("&") does not translate, even with urlencode %26

Run the command 'rclone version' and share the full output of the command.

rclone v1.57.0-DEV

  • os/version: alpine 3.15.0 (64 bit)
  • os/kernel: 4.15.0-50-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.7
  • go/linking: dynamic
  • go/tags: none

Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads
No

Which cloud storage system are you using? (eg Google Drive)

1Fichier

The command you were trying to run (eg rclone copy /tmp remote:tmp)

http://username:password@server:port/vfs/refresh?dir=Life%20%26%20Beth

The rclone config contents with secrets removed.

N/A

A log from the command with the -vv flag

{
	"result": {
		"Life \u0026 Beth": "file does not exist"
	}
}

The directory is called "Life & Beth" (without quotes) but urlencode of %26 doesn't seem to work. Seems like only %26 is being translated to \u0026, %2F for example is translating to "/".

I think that \u0026 is a valid encoding for & in JSON

>>> "Life \u0026 Beth"
'Life & Beth'

So I think it is OK.

When I try this on a test directory

$ ls
'Life & Beth'
rclone mount -vv --rc --rc-no-auth . /mnt/tmp/
$ curl -X POST -vv http://localhost:5572/vfs/refresh?dir=Life%20%26%20Beth
*   Trying 127.0.0.1:5572...
* Connected to localhost (127.0.0.1) port 5572 (#0)
> POST /vfs/refresh?dir=Life%20%26%20Beth HTTP/1.1
> Host: localhost:5572
> User-Agent: curl/7.74.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: authorization, Content-Type
< Access-Control-Allow-Origin: http://localhost:5572/
< Access-Control-Request-Method: POST, OPTIONS, GET, HEAD
< X-Rclone-Jobid: 1
< Date: Sat, 19 Mar 2022 16:23:57 GMT
< Content-Length: 47
< Content-Type: text/plain; charset=utf-8
< 
{
	"result": {
		"Life \u0026 Beth": "OK"
	}
}

It works for me.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.