An atmosphere package for adding image upload support to Autoform Fork from https://github.com/macsj200/autoform-images removed cropping
meteor add nnanna3wp:autoform-images
meteor npm install --save exif-js@2.2.1
We assume you have various S3 variables and MAXUpload configured in your Meteor.settings
file
{
"AWSAccessKeyId": "********************",
"AWSSecretAccessKey": "****************************************",
"AWSRegion": "*********",
"AWSBucket": "*************",
"MAXUploadMB": 10
}
You can just add a key of type: String
if you want. It's ok to declare this as an array of strings if you want multiple images.
You can specify the custom autoform component inline in the schema, or you can specify it after-the-fact in your UI code via Collection.simpleSchema().addAutoFormOptions(options)
.
Inline example
new SimpleSchema({
image:{
type: String,
autoform:{
afFieldInput:{
type: 'afImageElem',
}
},
},
});
Outside of schema example
dogsSchema = SimpleSchema({
image:{
type: String,
},
});
// ...
// possibly in some other file
Dogs.simpleSchema.addAutoFormOptions({
image:{
afFieldInput:{
type: 'afImageElem',
}
}
});
Now, just render an autoform somewhere that uses this schema.