澳门新莆京手机网站-新蒲京娱乐场 > 计算机 > 澳门新莆京手机网站ueditor使用-图片上传平常,图片彰显非常404

澳门新莆京手机网站ueditor使用-图片上传平常,图片彰显非常404

摘要: 近期在搭建自个儿的博客,那意气风发段时间恐怕没一时间来写博客了,不过有了好东西如故要享受给大家。博客网址必然要有编写制定成文的编辑器,所以在英特网查了些资料。超越百分之七十六编辑器的后台是基于java、php、asp等,很罕见依靠node.js的。本来是想用markdown来写小说,不过样式不佳调,所以最后如故筛选了百度的ueditor,其官英特网并从未基于node.js的代码。不过幸运的是自身在github上找到了叁个近乎的,所以将他分享给大家,假诺你思谋也用node.js来支付和煦的博客时能够参见下。

百度UEditor 后台配置项再次来到格式出错,上传功用将不可能健康使用!jsp版本
在本地调节和测量试验符合规律。上传到服务器后,浏览器调整台报错:后台配置项再次回到格式出错,上传成效将不可能健康使用!
澳门新莆京手机网站 1
澳门新莆京手机网站 2

做个小项目,用到了ueditor,此中需求在ueditor中上传图片。

下载援用:

打开ueditor.all.js
8094行:var config = isJsonp ? r:eval("("+r.responseText+")");
那句抛出极度。
打印isJsonp为false;
再打印r.responseText;
地点打印出:
{"videoMaxSize":102400000,"videoActionName":"uploadvideo","fileActionName":"uploadfile","fileManagerListPath":"/upload/file/","imageCompressBorder":1600,"imageManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"imageManagerListPath":"/upload/image/","fileMaxSize":51200000,"fileManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid",".rar",".zip",".tar",".gz",".7z",".bz2",".cab",".iso",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf",".txt",".md",".xml"],"fileManagerActionName":"listfile","snapscreenInsertAlign":"none","scrawlActionName":"uploadscrawl","videoFieldName":"upfile","imageCompressEnable":true,"videoUrlPrefix":"/MulinArticle","fileManagerUrlPrefix":"/MulinArticle","catcherAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"imageManagerActionName":"listimage","snapscreenPathFormat":"/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}","scrawlPathFormat":"/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}","scrawlMaxSize":2048000,"imageInsertAlign":"none","catcherPathFormat":"/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}","catcherMaxSize":2048000,"snapscreenUrlPrefix":"/MulinArticle","imagePathFormat":"/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}","imageManagerUrlPrefix":"/MulinArticle","scrawlUrlPrefix":"/MulinArticle","scrawlFieldName":"upfile","imageMaxSize":2048000,"imageAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"snapscreenActionName":"uploadimage","catcherActionName":"catchimage","fileFieldName":"upfile","fileUrlPrefix":"/MulinArticle","imageManagerInsertAlign":"none","catcherLocalDomain":["127.0.0.1","localhost","img.baidu.com"],"filePathFormat":"/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}","videoPathFormat":"/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}","fileManagerListSize":20,"imageActionName":"uploadimage","imageFieldName":"upfile","imageUrlPrefix":"/MulinArticle","scrawlInsertAlign":"none","fileAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid",".rar",".zip",".tar",".gz",".7z",".bz2",".cab",".iso",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf",".txt",".md",".xml"],"catcherUrlPrefix":"/MulinArticle","imageManagerListSize":20,"catcherFieldName":"source","videoAllowFiles":[".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid"]}

主题素材症状:

首先到ueditor官方网站络下载代码,作者下载的是付出版1.4.3php utf-8版本,解压之后将文件放到public目录下,此处小编将其重命名称叫ueditor。然后在您所急需的页面底部加上那三行

服务器打字与印刷出:
<%@ page language="java" contentType="text/html; charset=UTF-8"
import="com.baidu.ueditor.ActionEnter"
pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%

点击上传图片的按键后选用图片,上传到了指标文件夹,但是来得不断,f12查看也是404.新兴意识突显图片时路线不对。

复制代码 代码如下:

request.setCharacterEncoding( "utf-8" );response.setHeader("Content-Type" , "text/html");String rootPath = application.getRealPath;out.write( new ActionEnter( request, rootPath ).exec;

减轻方案:

下一场在急需的地点调用下边包车型地铁代码

%>

翻看官网文档,找到了个博客: 说的还蛮详细。找了下原因,笔者的谬误在于上传路径没难题,ueditor会依照ueditor/jsp/config.json中的对图片的门径配置来操作,关键点在于上传的任务和拜见图片时的职分:

复制代码 代码如下:

不知缘何是这么的结果,有未有大神蒙受过相仿的难点?

 1 "imageUrlPrefix": "", /* 图片访问路线前缀 */

上一篇:js 数组操作之pop,push,unshift,splice,shift 下一篇:没有了

Copyright © 2015-2019 http://www.carrefourstation.com. 澳门新莆京手机网站-新蒲京娱乐场有限公司 版权所有