Reduce the number of services you manage and securely attach files — images, documents, binaries, and more — directly to a database record.
Lightning fast file retrieval with an integrated CDN for low latency access.
Learn MorePerform 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 });
By Rishi Raj Jain
• January 4, 2024
Learn how to create a custom image gallery CMS using Xata, Astro, and Cloudflare Pages.
By Kostas Botsas
• September 14, 2023
Extracting text from File Attachments and indexing it with Python.
By Sorin Toma
• August 30, 2023
Extending a database record to include a new file column type with a global CDN, common security boundaries, and image transformations.
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.
Xata provides the best free plan in the industry. It is production ready by default and doesn't pause or cool-down. Take your time to build your business and upgrade when you're ready to scale.
Copyright © 2024 Xatabase Inc.
All rights reserved.