3

According to the Google Drive SDK, the size and MD5 hash of files is available through the API. Each resource (file) has an md5Checksum and a fileSize:

md5Checksum (string): An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.

fileSize (long): The size of the file in bytes. This is populated only for files with content stored in Drive.

How can I access them through Google's web interface? I'd like to avoid coding my own interface just for this.

2

There seem to be no way through Google Drive's interface (yet), however for a quick manual way you can use Google OAuth 2.0 Playground to call the Drive APIs List Files service and get the md5Checksum. I needed this to verify that some personal large file I uploaded got there properly, hence the answer is not exactly tailored for development purposes.

-1

API instructions

Google Developers - OAuth 2.0 Playground:

Step 1: Select & authorize APIs:

Step 2: Exchange authorization code for tokens:

  • Click "Exchange authorization code for tokens".

Step 3: Configure request to API:

  • Enter the "Request URI".
  • Click "Send the request".

Request URI instructions

All files in folder

Get specific fields of files in a folder:

https://www.googleapis.com/drive/v3/files?q="folderId"+in+parents&fields=files(md5Checksum,+originalFilename,+size)
//

Replace "folderId" with the folder ID.

You can use &fields=files(*) to get all of the file's fields.

Single file

Get specific fields of a file:

https://www.googleapis.com/drive/v3/files/fileId?fields=md5Checksum,+originalFilename,+size
//

Replace "fileId" with the file ID.

You can use &fields=* to get all of the file's fields.

Parsing the JSON response

  • Open a JavaScript console.
  • Save the object into a variable.
  • Map the object.
  • Copy the result.

Code

var response = {
  "files": [
    {
      "md5Checksum": "0cc175b9c0f1b6a831c399e269772661", 
      "originalFilename": "a.txt"
    }, 
    {
      "md5Checksum": "92eb5ffee6ae2fec3ad71c777531578f", 
      "originalFilename": "b.txt"
    }
  ]
};


var result = response.files.map(function (file) { return (file.md5Checksum + " *" + file.originalFilename); }).join("\r\n");

console.log(result);
copy(result);
  • Perhaps you missed the part where the Asker said: "How can I access them through Google's web interface? I'd like to avoid coding my own interface just for this." – ale Mar 1 '18 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.