多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
指定上传的 URL: window.UMEDITOR\_CONFIG.upload\_url <?php include\_include(ADMIN\_PATH.'view/htm/footer.inc.htm');?> <link href="../plugin/xn\_umeditor/umeditor/themes/default/css/umeditor.css<?phpecho $static\_version;?>"type="text/css"rel="stylesheet"/> <linkhref="../plugin/xn\_umeditor/umeditor/umeditor-bbs.css<?phpecho$static\_v ersion;?>"type="text/css"rel="stylesheet"/> <script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor.config.js<?php echo $static\_version;?>"></script> <script>window.UMEDITOR\_CONFIG.upload\_url=xn.url('product-upload\_image');</script> <script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor.js< ?php echo $static\_version;?>"></script> <script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor-insertcode.js<?php echo $static\_version;?>"></script> <script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor-bbs .js<?php echo $static\_version;?>"></script> <script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/lang/zh-cn/zh-cn.js<?php echo $static\_version;?>"></script> 服务端处理上传,范例: <?php // ... if($action=='upload\_image') { $width =param('width',0); $height =param('height',0); $is\_image=param('is\_image',0); $name =param('name'); $data =param\_base64('data'); $conf\['upload\_url'\]=substr(http\_url\_path(),0,-6) .$conf\['upload\_url'\]; $product\_image\_path=$conf\['upload\_path'\].'product\_image/'.date('Ym'). ![](https://img.kancloud.cn/fe/c5/fec53588eca168b906f3e894e110eb9a_31x31.png)![](https://img.kancloud.cn/07/37/0737da087836e783fa1e9fccc19cb34e_31x32.png)![](https://img.kancloud.cn/d6/b9/d6b9ae02b071d0b5e570b8d307643246_20x31.png)'/'; $product\_image\_url =$conf\['upload\_url'\].'product\_image/'.date('Ym').'/'; xn\_mkdir($product\_image\_path,0777,TRUE); empty($group\['allowattach'\])AND$gid!=1ANDmessage(-1,'您无权上传');empty($data)ANDmessage(-1,lang('data\_is\_empty')); $filesize=strlen($data); //$size>20480000ANDmessage(-1,lang('filesize\_too\_large',array('maxsiz e'=>'20M','size'=>$size))); // 111.php.shtmll $ext =file\_ext($name,7); $filetypes=include APP\_PATH.'conf/attach.conf.php'; !in\_array($ext,$filetypes\['all'\])AND $ext='\_'.$ext; $filetype=attach\_type($name,$filetypes); $tmpanme=$uid.'\_'.xn\_rand(15) .'.'.$ext; $tmpfile=$product\_image\_path.$tmpanme; $tmpurl =$product\_image\_url.$tmpanme; file\_put\_contents($tmpfile,$data)ORmessage(-1,lang('write\_to\_file\_faile d')); $attach=array( 'url' =>$tmpurl, 'path' =>$tmpfile,'orgfilename'=>$name,'filetype' =>$filetype,'filesize' =>$filesize,'width' =>$width, 'height' =>$height,'isimage' =>$is\_image, ); message(0,$attach); } ?>