0
안녕하십니까.CollectionFS Meteor, WYSIWYG, Summernote, 이미지 업로드
저는 WYSIWYG 편집기 및 collectionFS를 사용하여 Meteor에서 작동하도록 파일 업로드를 얻는 데 어려움을 겪었습니다. 나는 Summernote와 함께 노력해 왔지만 Redactor 나 Froala를 사용해도 상관하지 않습니다.
파일을 로컬 경로에 업로드하기 위해 WYSIWYG 편집기를 CollectionFS에 연결하는 데 숙련 된 기술이 부족합니다.
여기 내 코드가 있습니다. 내 짧은 지식에서
Template.postSubmit.rendered = function(){
$('#edit').summernote();
};
Template.postSubmit.events({
'submit #postSubmit':function(event, template) {
FS.Utility.eachFile(event, function(file) {
Images.insert(file, function (err, fileObj) {
//Inserted new doc with ID fileObj._id, and kicked off the data upload using HTTP
});
});
}
});
Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: "img2"})]
});
Images.allow({
insert: function() {
return true;
},
update: function() {
return true;
},
remove: function() {
return true;
},
download: function() {
return true;
}
});
, 나는 (I합니까?)을 summernote 스크립트 내에서
onImageUpload: function(files, editor, welEditable) {
sendFile(files[0],editor,welEditable);
}
을 추가해야합니다.
나는이 작품을 만들 수없는 것 같습니다! 포인터는, 가이드 및 도움을 크게 ... 감사하겠습니다
EDIT1 : 그래서 나는이 내 코드를 수정했습니다, 그리고 지금이 작동
Template.postSubmit.rendered = function(){
$('#edit').summernote({
onImageUpload: function(file) {
FS.Utility.eachFile(event, function(file) {
Images.insert(file, function (err, fileObj) {
//Inserted new doc with ID fileObj._id, and kicked off the data upload using HTTP
});
});
}
});
};
! 파일을 지정된 경로에 업로드합니다. 문제는 지금 입니다. 1. 이미지를 즉시 업로드합니다 (양식을 제출할 때가 아니라 이미지 추가를 클릭하자마자). 2. 업로드 된 이미지가 편집기에 표시되지 않을 수 있습니다.
http://stackoverflow.com/questions/21628222/summernote-image-upload 희망이 도움이됩니다. – Ironic
이 질문은 중복 될 수 있습니다. https://stackoverflow.com/questions/27449455/collectionfs-meteor-js-summernotewysiwyg-and-file-upload/31512800#31512800 아직 해결 방법이 없습니다! – daslicht