1.0 KiB
Minimal Uploader
This small utility uses environment variables in your environment (.env or other) to create a folder under a configured parent item in a drive, create a subfolder, and upload a PDF file.
Important: It expects the following environment variables to be available (use your existing .env to supply these values):
- CLIENT_ID
- CLIENT_SECRET
- TENANT_ID
- DRIVE_ID
- PARENT_ITEM_ID
Usage:
-
Ensure your environment has the required variables populated (you can copy your existing .env file into this folder or run the script from the repo root where the env is defined).
-
Install dependencies:
npm install
-
Dry-run (simulate without hitting Graph):
npm run check
-
Create folder, subfolder and upload a sample PDF (one-shot):
npm start
This script performs the operation with the app-only client credential flow (it will use the exact values from the environment variables). The uploaded PDF is a small made-up payload; all other values are read from environment variables (exact by design).