0
react js와 함께 tinyMCE 편집기 플러그인을 사용하고 있습니다. 내 로컬 컴퓨터에서 편집기로 파일을 업로드하려고 시도한 다음 s3으로 업로드하려고합니다. 사진을 편집기로 드래그 앤 드롭 할 수는 있지만 사진 삽입 버튼을 클릭하면 파일 시스템에 액세스 할 수 없습니다. 어떤 제안?React가있는 TinyMCE 편집기 로컬 파일에 액세스 할 수 없습니다.
class Editor extends React.Component{
handleEditorChange = (e) => {
console.log('e',e);
console.log('Content was updated:', e.target.getContent());
}
render(){
return(
<TinyMCE
content="<p>This is the initial content of the editor</p>"
config={{
height:600,
paste_data_images: true,
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace wordcount visualblocks code fullscreen',
'insertdatetime media table contextmenu paste code'
],
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', file_picker_types: 'file image media',
paste_data_images:true,
file_browser_callback_types: 'image',
images_upload_handler: function (blobInfo, success, failure) {
console.log('blobInfo',blobInfo);
},
selector: 'textarea', // change this value according to your HTML
file_picker_callback: function(callback, value, meta) {
if (meta.filetype == 'file') {
//callback('mypage.html', {text: 'My text'});
}
if (meta.filetype == 'image') {
}
if (meta.filetype == 'media') {
//callback('movie.mp4', {source2: 'alt.ogg', poster: 'image.jpg'});
}
}
}}
onChange={this.handleEditorChange}
/>
)
}
}
export default Editor