I am trying to save uploaded images into public/images folder of my meteor project, so I wrote this code.
Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: "images"})]
});
But when I upload images, the files are saved into
.meteor/local/build/programs/server/images/
folder instead of public/images folder.
So how can I set path or what to save images to public/images folder instead of .meteor folder?
I will explain why I need it.
I have one other collection, buildings, which has this format.
Schemas.Buildings = new SimpleSchema({
'name': {
type: String,
label: 'What is the name of the building?',
max: 200,
unique: true
},
'picture': {
type: String,
max: 200,
optional: true,
label: " ",
autoform: {
afFieldInput: {
type: 'fileUpload',
collection: 'Images',
accept: 'image/*',
label: 'Choose Aerial Image'
}
}
}
And because I need to set sample buildings with pictures, so I need to put sample images to public/images/ folder and use them to set picture values of sample buildings in Meteor.startup bootstrap.
If I put that images to .meteor folder, it will be removed by meteor reset command, so I hope to persist the images to public folder.
Please teach me!