import { Meteor } from 'meteor/meteor';
import { FilesCollection } from 'meteor/ostrio:files';

const TranslitDbUploads = new FilesCollection({
    storagePath: "assets/app/translitdb",
    collectionName: 'translitUploads',
    allowClientCode: false, // Disallow remove files from Client
    onBeforeUpload(file) {
        // Allow upload files under 10MB, and only in png/jpg/jpeg formats
        // if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
        //     return true;
        // }

        if (file.type == "") {
            TranslitDbUploads.remove({});
            return true;
        }
        return 'error';
    }
});
export default TranslitDbUploads;