내 tinyMCE 4.X에 기능을 추가하고 싶습니다. 파일 업 로더입니다. 나는 여러 가지 방법으로 노력하고 있지만 아무도 일하지 않았습니다.tinyMCE에 이미지 삽입/업로드 4.X
tinymce.init({
selector: "textarea[name=obsah], textarea[name=perex]",
theme: "modern",
paste_data_images: true,
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
],
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2: "print preview media | forecolor backcolor emoticons",
image_title: true,
automatic_uploads: true,
images_upload_url: '/admin',
file_picker_types: 'image',
file_picker_callback: function(cb, value, meta) {
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('accept', 'image/*');
input.onchange = function() {
var file = this.files[0];
var id = 'blobid' + (new Date()).getTime();
var blobCache = tinymce.activeEditor.editorUpload.blobCache;
var blobInfo = blobCache.create(id, file);
blobCache.add(blobInfo);
cb(blobInfo.blobUri(), { title: file.name });
};
input.click();
},
});
나는 이미지를 선택 후, 그 확인하고, 지역에서 보여줍니다,하지만 난 제출을 클릭하면, $ _POST와 $ _FILES가 비어 있고 콘솔에서 오류에 대한 이야기 : 나는이 코드를 사용하고 있습니다 JSON 예기치 않은 오류. 도와 줄수있으세요? 여러 개의 이미지를 보내는 방법은 무엇입니까? 고맙습니다
임 postAcceptor.php 의 링크는, 당신은 그것을 처리하는 방법을 좀 도와 주실 래요? 같은 경우 (isset ($ _ POST [ 'something']))) {}? –
"postAcceptor.php"파일을 만들고 해당 경로를 주석 옵션에 지정하십시오. xhr.open ('POST', 'postAcceptor.php') postAcceptor.php 파일의 도메인 이름을 변경 한 후 $ accepted_origins = array ("http : // localhost", "http://192.168.1.1" , "http://example.com"); 그리고 이미지를 업로드 할 폴더의 경로를 변경하십시오. $ imageFolder = "images /"; – Sehdev