Skip to content
the poor coder

google drive show size folder

Poor Man
Published
Reading time
2 min read
On this page

How to Check the Size of a Folder in Google Drive#

Google Drive is a cloud storage service that allows users to store and share files and folders online. Checking the size of a folder in Google Drive can be helpful for managing your storage space and organizing your files. Here are the steps to check the size of a folder in Google Drive:

Method 1: Using Google Drive Web Version#

  1. Open your web browser and go to https://drive.google.com.
  2. Log in to your Google account if you haven't already.
  3. Navigate to the folder whose size you want to check.
  4. Right-click on the folder and select "Get Info".
  5. A pop-up window will appear showing the size of the folder and its contents.

Method 2: Using Google Drive Desktop App#

  1. Download and install the Google Drive desktop app on your computer.
  2. Sign in to your Google account.
  3. Open the Google Drive folder on your computer.
  4. Find the folder whose size you want to check.
  5. Right-click on the folder and select "Properties".
  6. A pop-up window will appear showing the size of the folder and its contents.

Method 3: Using Google Drive API#

If you are a developer, you can use the Google Drive API to retrieve the size of a folder programmatically. Here is an example code snippet in Python:

Text

import os
from google.oauth2 import service_account
from googleapiclient.discovery import build

# Replace with your own service account credentials
SERVICE_ACCOUNT_FILE = 'path/to/your/service/account.json'
SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly']

# Authenticate with the Google Drive API using service account credentials
creds = None
creds = service_account.Credentials.from_service_account_file(
    SERVICE_ACCOUNT_FILE, scopes=SCOPES)
service = build('drive', 'v3', credentials=creds)

# Replace with the ID of the folder you want to check
folder_id = 'your-folder-id'

# Call the Google Drive API to retrieve the folder metadata
folder = service.files().get(fileId=folder_id, fields='size').execute()

# Print the size of the folder in bytes
print("Folder Size: {} bytes".format(folder['size']))

Before running the code, you need to replace the SERVICE_ACCOUNT_FILE variable with the path to your own service account credentials file, and the folder_id variable with the ID of the folder you want to check. Once you run the code, it will print the size of the folder in bytes.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC