0
私は絵があなたの助けのためにアレイの画像を表示する方法は?
本当にありがとうございましたを示した場合、それが配列でない場合は、私はこのエラーに
Exception in queued task: Error: Invalid selector: tzYd8ocD9xhvCCfk7
を持って、これらのパッケージに
aldeed:collection2,
aldeed:autoform,
cfs:standard-packages,
yogiben:autoform-file,
cfs:filesystem.
{{#with FS.GetFile "images" pictures}}
<img src="{{this.url}}" alt="" class="card-img-bottom">
{{/with}}
Images = new FS.Collection("images",{
stores: [new FS.Store.FileSystem("images")],
filter:{
allow:{
contentTypes: ['image/*']
}
}
});
Images.allow({
insert: function(userId,fileObj){
return true;
},
update:function(userId,fileObj){
return true;
},
download: function(userId,fileObj){
return true;
}
});
Posts = new Mongo.Collection('posts');
Posts.allow({
insert:function(userId,fileObj){
return true;
},
update:function(userId,fileObj){
return true;
}
});
PostSchema = new SimpleSchema({
title:{
type: String,
autoform:{
label:false,
type:"textarea",
placeholder:"Comparte con la comunidad"
}
},
pictures:{
type:[String],
optional: true,
label: " "
},
'pictures.$':{
autoform:{
type:"fileUpload",
collection: 'images',
selectFileBtnTemplate: 'mySelectFileBtn',
previewTemplate: 'myFilePreview',
uploadProgressTemplate: 'myUploadProgressTemplate'
}
},
author:{
type:String,
label: "Author",
autoValue: function(){
return this.userId
},
autoform:{
type:"hidden"
}
},
createdAt:{
type: Date,
label: "created At",
autoValue:function(){
return new Date()
},
autoform:{
type:"hidden"
}
}
});
Posts.attachSchema(PostSchema);
を使用しています。
すでにアップロードされている画像を表示したい場合 –
画像をサーバーに公開し、表示する前にクライアントに登録する必要があります –