Use case: avatars and galleries

Avatars, logos and galleries for your SaaS app

Profile photos, logos and galleries uploaded once and shown at every size by changing the URL.

SaaS avatars and galleries

The problem

Every app ends up with profile photos, team logos and a gallery or two. Each needs an uploader, storage, and the picture at a handful of sizes: a 32px avatar, a card, a full-screen view.

Making and storing each size yourself means a pipeline to maintain, and a migration every time the design changes.

A short code path

A gallery and an avatar (React)
import { FileboyProvider, Image, MultiFileUploader } from "@cd2/fileboy-react"

export function Gallery({ photoIds, onAdded }: { photoIds: string[]; onAdded(ids: string[]): void }) {
  return (
    <FileboyProvider publicKey="YOUR_PUBLIC_KEY">
      <MultiFileUploader allow="image/*" onFilesUploaded={files => onAdded(files.map(f => f.id))} />
      {photoIds.map(id => (
        <Image
          key={id}
          id={id}
          transforms={[
            { type: "resize", width: 400, height: 300, fit: "cover" },
            { type: "format", format: "webp" },
          ]}
        />
      ))}
    </FileboyProvider>
  )
}

export function Avatar({ fileId, size = 48 }: { fileId: string; size?: number }) {
  return (
    <Image
      id={fileId}
      transforms={[{ type: "resize", width: size * 2, height: size * 2, fit: "cover", position: "top" }]}
      imgProps={{ width: size, height: size, alt: "", style: { borderRadius: "50%" } }}
    />
  )
}

Save each file's id in your database. Ask for twice the displayed size so images stay sharp on high-density screens.

What Fileboy does not do here

  • A full digital asset manager, with approval workflows and collections.
  • Generative image editing as a URL transform. AI background removal and upscaling are API calls that make a new file, on paid plans.

Try it with your own files

Create a free app, paste your public key into the code on this page and upload something of yours. The free plan needs no card.