Rclone ls, rclone lsjson: file extension / MIME for native Google Documents

Hello

What is the problem you are having with rclone?

For a Google Drive remote, commands like rclone ls, rclone lsjson do not report the right file extension / mime type for native Google Docs, Google Slides, Google Presentations.

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

rclone v1.74.3
- os/version: debian forky/sid (64 bit)
- os/kernel: 7.0.12+deb14.1-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.26.4
- go/linking: static
- go/tags: none

Which cloud storage system are you using?

Google Drive

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

rclone lsjson drive:z -M -vv --log-file=log.txt
[
  {
    "Path": "Document sans titre.docx",
    "Name": "Document sans titre.docx",
    "Size": -1,
    "MimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    "ModTime": "2026-06-14T07:58:41.466Z",
    "IsDir": false,
    "ID": "<FileID>",
    "Metadata": {
      "btime": "2026-06-14T07:58:34.026Z",
      "content-type": "application/vnd.google-apps.document",
      "copy-requires-writer-permission": "false",
      "mtime": "2026-06-14T07:58:41.466Z",
      "owner": "<xxxx@example.com>",
      "starred": "false",
      "viewed-by-me": "true",
      "writers-can-share": "true"
    }
  }
]

The Google Doc above was directly created in Google Drive web interface. There is no file extension in the name. However, rclone adds a .docx in the Name and Path fields. The MimeType is also not correct.

Metadata.content-type shows the right MIME type for a native Google Doc.

rclone v1.55.1 is the last version that gives the correct names without file extension for this kind of documents:

./rclone-v1.55.1 lsjson drive:z | jq .
[
  {
    "Path": "Document sans titre",
    "Name": "Document sans titre",
    "Size": 1024,
    "MimeType": "application/vnd.google-apps.document",
    "ModTime": "2026-06-14T07:58:41.466Z",
    "IsDir": false,
    "ID": "<FILE_ID>"
  }
]

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[drive]
type = drive
client_id = XXX
client_secret = XXX
root_folder_id = XXX
scope = drive
token = XXX
team_drive =

A log from the command that you were trying to run with the -vv flag

2026/06/14 14:47:35 DEBUG : rclone: Version "v1.74.3" starting with parameters ["./rclone-v1.74.3" "lsjson" "drive:z" "-M" "-vv" "--log-file=log.txt"]
2026/06/14 14:47:35 DEBUG : Creating backend with remote "drive:z"
2026/06/14 14:47:35 DEBUG : Using config file from "/home/user/tmp/zz-drive/rclone.conf"
2026/06/14 14:47:36 DEBUG : 6 go routines active

Metadata reported by Drive API

curl --header "Authorization: Bearer $ACCESS_TOKEN" 'https://www.googleapis.com/drive/v3/files/$FILE_ID?fields=kind,mimeType,createdTime,id,name,size,version,modifiedTime'
{
  "kind": "drive#file",
  "id": "<FILE_ID>",
  "name": "Document sans titre",
  "mimeType": "application/vnd.google-apps.document",
  "version": "7",
  "createdTime": "2026-06-14T07:58:34.026Z",
  "modifiedTime": "2026-06-14T07:58:41.466Z",
  "size": "1024"
}

I think this is probably coming from the Drive export-format layer rather than the raw Drive metadata. Native Google Docs are not normal downloadable files, so recent rclone versions expose them as the selected export format, which is why lsjson shows the .docx name and the OOXML MIME type. With -M you still have the original Google type in Metadata.content-type. If your script needs to distinguish native Docs from real .docx files, I would key off Metadata.content-type == application/vnd.google-apps.document, not MimeType. The v1.55.1 comparison is useful though, because it shows the behavior change clearly.

Note. The difference of behaviour between rclone v1.55.1 and the v.1.56.0 seems to be caused by https://github.com/rclone/rclone/commit/94b1439299e57f84dec27e865fba2b7356f3ea79

Try the flag --drive-show-all-gdocs

That will remove the extension and show unexportable Google docs too.

Thanks. Indeed, using the flag --drive-show-all-gdocs produces the expected output.