File Management

Manage your files efficiently with code

Add the logic to create, update, rename, and remove files directly into your application.

Upload a new file to your storage with the metadata you specify.

TS  storage.ts
import { Storage } from '@cloud/storage';

const storage = new Storage('st_xxxxxxxxx');

const file = await storage.files.create({
  name: 'document.pdf',
  path: '/documents/',
  size: 1024000,
  type: 'application/pdf',
  metadata: { author: 'John Doe' }
});