Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LocalFile Contents Scratch
{ fieldname: 'file',
originalname: 'Advanced example.md',
name: '1458848e82f2de780e5ad963d93606aa.md',
encoding: '7bit',
mimetype: 'text/markdown',
path: '/var/folders/ck/y02pffhs31xd_k4xc9xmn3hw0000gn/T/1458848e82f2de780e5ad963d93606aa.md',
extension: 'md',
size: 7703,
truncated: false,
buffer: null } }
dest: 'uploads',
filename (file) {
if (options.overwrite) return file.originalname;
return item.id + '-' + Date.now() + '-' + file.originalname;
}
format (value) {
return value.path.substr(value.path.lastIndexOf('/'));
}
href (value) {
return value.path.replace(/uploads/, 'files/uploaded');
}
uploads/me.jpg
thinkmill.com.au/files/uploaded/me.jpg
{
type: 'text/markdown',
filename: 'Advanced example.md',
path: 'uploads',
size: 7703,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.