<commit_before>var keystone = require('keystone');
var transform = require('model-transform');
var Types = keystone.Field.Types;

var File = new keystone.List('File');

var UploadStore = new keystone.Storage({
	adapter: keystone.Storage.Adapters.FS,
	path: 'uploads',
	publicPath: '/files/uploads/',
});
<commit_msg>Tweaked keystone.Storage definition<commit_after>var keystone = require('keystone');
var transform = require('model-transform');
var path = require('path');
var Types = keystone.Field.Types;

var File = new keystone.List('File');

var UploadStore = new keystone.Storage({
	adapter: keystone.Storage.Adapters.FS,
	path: keystone.expandPath('uploads'),
	// path: '../uploads',
	// path: path.normalize(__dirname + '/../uploads'),
	publicPath: '/files/uploads/',
	schema: {
		path: true,
		originalname: true,
	},

	// default: random, retry.

	generateFilename: keystone.Storage.filenameFromHash, // or filenameFromUpload filenameFromRandom
	// generateFilename: (item, file, i) => file.originalname,
	whenExists: 'overwrite', // 'error' 'retry'
});

{'fraction_non_alphanumeric': 0.162593984962406, 'fraction_numerical': 0.0, 'mean_word_length': 5.120689655172414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2431418', 'n_tokens_mistral': 357, 'n_tokens_neox': 330, 'n_words': 78}