Attach files and images to your database

Reduce the number of services you manage and securely attach files — images, documents, binaries, and more — directly to a database record.

Fast retrieval

Lightning fast file retrieval with an integrated CDN for low latency access

Learn More

Secure by default

Control access through your database roles and URL access levels

Learn More

On-the-fly transformations

Peform resize, crop, rotate, and many other transformations in-code through the SDKs

Learn More

Built-in search

Files are storage directly on records in your database, making it easy to search and filter your files

Learn More

Sleek administration

Add the File column type to your database and immediately start uploading content into the Xata app.

Store images, movies, PDFs and other files types. Preview your uploads in the app, regardless of their size.

Add column to table

Image transformations

Compress, style, resize and format your images on the fly

// Get a specific record from the "gallery" database
const record = await xata.db.gallery.read('record_id');
 
const { url } = record.imageColumnName.transform({
  height: 100,
  rotate: 180,
  format: 'webp'
});

Original

original

Transformed

transformed

File access control

Keep files private, make them public, or use signed URLs to enable time-limited access

// Set the timeout to be 10 minutes for this user's photo
const user = await xata.db.Users.update('record_id', {
  photo: {
    signedUrlTimeout: 600 // In seconds
  }
});
 
// Retrieve the signed URL on the file in the "photo" column
const { signedUrl } = user.photo.transform({ quality: 50 });

Learn by example

Check out a sample app

Built with Next.js, Chakra UI, and Xata, the sample app will help you learn how to query, paginate and search records with a heavy focus on file attachments.

Add column to table

Common questions

How does the pricing work?

File attachments are rolled into the size on disk per unit. In the free tier, you get up to 15GB of storage free. After that, it is 5GB per unit. To see details on the Xata units, please visit our pricing page.

How are the files stored and served?

Behind the scenes, the files are stored in S3 and served on a Cloudflare CDN. For more details, check out our documentation.