lib/storage/adapters/fs/README.md
This adapter is used for storing uploaded files on your server's local filesystem.
Configure the FS adapter:
var storage = new keystone.Storage({
adapter: keystone.Storage.Adapters.FS,
fs: {
path: keystone.expandPath('./uploads'), // required; path where the files should be stored
publicPath: '/public/uploads', // path where files will be served
}
});
Then use it as a storage provider for a File field:
MyList.add({
file: { type: Types.File, storage: myStorage },
});
The adapter requires an additional fs field added to the storage options. it accepts the following values:
file data, the attempt number and the callback to call with the filename.
keystone-storage-namefunctions for additional filename generators, including content hash filename and original filename. See its source for more information on how to write your own.'retry', 'error' or 'overwrite'.whenExists is set to 'retry', how many times keystone should try to generate a unique filename before returning an errorThe FS adapter supports all the default Keystone file schema fields. It also additionally supports and enables the filename path (required).
{
filename: String,
}