Created
April 11, 2016 14:10
-
-
Save JedWatson/182a3eda34301cb19da310ad32f26919 to your computer and use it in GitHub Desktop.
LocalFile Contents Scratch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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