Reduce the number of services you manage and securely attach files — images, documents, binaries, and more — directly to a database record.
Peform resize, crop, rotate, and many other transformations in-code through the SDKs
Learn MoreFiles are storage directly on records in your database, making it easy to search and filter your files
Learn MoreAdd 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.
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'
});
img = xata.files().transform("https://us-east-1.storage.xata.sh/4u1fh2o6p10blbutjnphcste94", {
"height": 100,
"rotate": 180,
"format": "webp"
})
https://us-east-1.storage.xata.sh/transform/height=50,format=webp/4u1fh2o6p10blbutjnphcste94
Original
Transformed
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 });
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.
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.
Behind the scenes, the files are stored in S3 and served on a Cloudflare CDN. For more details, check out our documentation.