use tempdirs

This commit is contained in:
David Arnold 2020-10-21 12:39:49 -05:00 committed by Denis Perov
parent 06b812b590
commit 80d0ec0898
3 changed files with 20 additions and 12 deletions

View file

@ -5,6 +5,8 @@ import { createOnAfterUpload } from './lib/fsHooks/createOnAfterUpload';
import { createInterceptDownload } from './lib/fsHooks/createInterceptDownload';
import { createOnAfterRemove } from './lib/fsHooks/createOnAfterRemove';
const os = require('os');
let avatarsBucket;
if (Meteor.isServer) {
avatarsBucket = createBucket('avatars');
@ -13,6 +15,7 @@ if (Meteor.isServer) {
Avatars = new FilesCollection({
debug: false, // Change to `true` for debugging
collectionName: 'avatars',
storagePath: os.tmpdir(),
allowClientCode: true,
onBeforeUpload(file) {
if (file.size <= 72000 && file.type.startsWith('image/')) {