packages/file-storage/README.md
Key/value storage interfaces for server-side File objects. file-storage gives Remix apps one consistent API across local disk and memory backends.
Files instead of strings)File metadata including file.name, file.type, and file.lastModifiednpm i remix
import { createFsFileStorage } from 'remix/file-storage/fs'
let storage = createFsFileStorage('./user/files')
let file = new File(['hello world'], 'hello.txt', { type: 'text/plain' })
let key = 'hello-key'
// Put the file in storage.
await storage.set(key, file)
// Then, sometime later...
let fileFromStorage = await storage.get(key)
// All of the original file's metadata is intact
fileFromStorage.name // 'hello.txt'
fileFromStorage.type // 'text/plain'
// To remove from storage
await storage.remove(key)
file-storage-s3 - S3 backend for file-storageform-data-parser - Pairs well with this library for storing FileUpload objects received in multipart/form-data requestslazy-file - The streaming File implementation used internally to stream files from storageSee LICENSE