Télécharger fichier vers Google Drive

VérifiéSûr

Télécharge un fichier local vers Google Drive via OAuth2. Supporte l'identifiant de dossier optionnel.

Spar Skills Guide Bot
ProductiviteDébutant
1024/07/2026
Claude Code
#google-drive#file-upload#cloud-storage#file-management

Recommandé pour

Notre avis

Télécharge un fichier local vers Google Drive en utilisant l'authentification OAuth2 préalablement configurée.

Points forts

  • Intégration simple et directe avec Google Drive.
  • Prise en charge des dossiers cibles optionnels.
  • Rapporte clairement le lien de partage du fichier uploadé.

Limites

  • Nécessite une authentification OAuth2 préalable via gdrive-auth.
  • Ne gère pas les gros fichiers ou les répertoires entiers.
  • Pas de support pour les formats ou la conversion de fichiers.
Quand l'utiliser

Utilisez cette compétence lorsque vous avez besoin de sauvegarder rapidement un fichier local spécifique dans Google Drive.

Quand l'éviter

Ne l'utilisez pas pour des transferts de masse ou des sauvegardes récurrentes, car chaque upload nécessite une commande distincte.

Analyse de sécurité

Sûr
Score qualité90/100

The skill uses Bash only to check file existence and invokes a known project script for upload. No destructive or obfuscated actions are present, and the operation is explicitly requested by the user.

Aucun point d'attention détecté

Exemples

Upload file to root
Upload my report.txt to Google Drive.
Upload file to specific folder
Save notes.txt to my Google Drive folder with ID 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs.

name: gdrive-save description: Uploads a local file to Google Drive using the OAuth2 token from gdrive-auth/. Auto-invoke when user asks to upload, save, or push a local file to Google Drive. argument-hint: "<file-path> [--folder <gdrive-folder-id>]"

Required Tools

  • Bash
  • AskUserQuestion

Input Parsing

Parse $ARGUMENTS for:

  • file-path: required positional argument — path to the local file to upload
  • --folder <gdrive-folder-id>: optional — Google Drive folder ID to upload into; defaults to Drive root

If file-path is missing, ask:

AskUserQuestion: "Please provide the path to the local file you want to upload to Google Drive."

If --folder flag is present but no ID follows, ask:

AskUserQuestion: "Please provide the Google Drive folder ID to upload into."

Resolve the file path relative to the current working directory if it is not absolute.

Step 1 — Verify File Exists

Use Bash to check the file exists:

test -f "<file-path>" && echo "ok" || echo "not found"

If the file is not found, report an error and stop:

Error: File not found — <file-path>

Step 2 — Run Upload Script

Run the upload script from the project root. Include --folder if it was provided:

node gdrive-save.js "<file-path>" [--folder "<folder-id>"]

Example with folder:

node gdrive-save.js "notes.txt" --folder "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs"

The script outputs three lines on success:

Uploaded: <filename>
ID: <google-drive-file-id>
Link: <webViewLink>

If the script exits with a non-zero code or prints "Upload failed:", report the error and stop:

Error: Upload failed — <error message from script>

Step 3 — Report

Output a single confirmation block:

Uploaded "<filename>" → Google Drive
ID: <file-id>
Link: <webViewLink>
Skills similaires