Manikandan
Manikandan

Reputation: 95

What is format of Google Drive's FileID ? I need to find out whether new File has been uploaded to my drive or not using API's

If FileID follows a particular format like new file has higher values or lower values I can keep track of the old values and find out whether I hace uploaded a new File in drive.

Upvotes: 6

Views: 4153

Answers (2)

Aaron Goldman
Aaron Goldman

Reputation: 929

The format is a 264 bit number

bit 0   5 6             261 261 263
+--------+-----------------+-------+
| 110101 | 256 RANDOM BITS | 00    |
+--------+-----------------+-------+

url safe base64 encoded as

/1[a-zA-Z0-9_-]{42}[AEIMQUYcgkosw048]/

You can store just the random part as a Byte[32] but it is safer to treat it as a random string as this may change at any time

Upvotes: 10

pinoyyid
pinoyyid

Reputation: 22306

File ID is just a random string - there is no format.

You are taking the wrong approach. Look at the changes resource https://developers.google.com/drive/v3/reference/changes

Upvotes: 0

Related Questions