php结合simidtor编辑器,怎么进行多图上传?网上很多人讲,但是大同小异,而且解决不了问题。我php这边可以返回上传成功后的图片路径,但是simidtor好像不吃这一套,官网文档也没讲过这个事情,以前吹后台开发,前端基础比较差,看不太懂前端代码。
<textarea id="editor" name="product_content"></textarea>
<script type="text/javascript">
$(function(){
toolbar = [ 'title', 'bold', 'italic', 'underline', 'strikethrough',
'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|',
'link', 'image', 'hr', '|', 'indent', 'outdent' ];
var editor = new Simditor( {
textarea : $('#editor'),
placeholder : '这里输入内容...',
toolbar : toolbar, //工具栏
// defaultImage : '__PUBLIC__/simditor-2.3.6/images/image.png', //编辑器插入图片时使用的默认图片
upload : {
url : 'uploadImage', //文件上传的接口地址
params: null, //键值对,指定文件上传接口的额外参数,上传的时候随文件一起提交
fileKey: 'fileData', //服务器端获取文件数据的参数名
connectionCount: 3,
pasteImage:true,
leaveConfirm: '正在上传文件'
}
});
})
</script>
该引入的文件已经引入,现在问题是,我图片上传成功后,应该返回什么东西给前端,才可以正确显示图片呢?请懂的人顺便分析一下前端代码,谢谢!
已经在simidtor.js里面加上:
return $input = $('<input/>', {
type: 'file',
name: 'fileData',
title: _this._t('uploadImage'),
multiple: true,
accept: 'image/*'
}).appendTo($uploadItem);
后台就是根据这个name属性获取FILES数组的。
学会看官方文档:http://simditor.tower.im/docs...
