durow / ueditornetcore Goto Github PK
View Code? Open in Web Editor NEWUEditor for .net core!
UEditor for .net core!
错误信息:
Uncaught SyntaxError: Unexpected token (index):1
返回的页面中汉字全部乱码,第一行如下,不知什么原因引起的:
<!DOCTYPE html> <!--STATUS OK--> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <meta name="description" content="鐧惧害鍥剧墖浣跨敤涓栫晫鍓嶆部鐨勪汉宸ユ櫤鑳芥妧鏈紝涓虹敤鎴风攧閫夋捣閲忕殑楂樻竻缇庡浘锛岀敤鏇存祦鐣呫�佹洿蹇嵎銆佹洿绮惧噯鐨勬悳绱綋楠岋紝甯︿綘鍘诲彂鐜板褰╃殑涓栫晫銆�"> <script>
例如:http://news.163.com/17/0113/10/CALDUGQM000187VE.html 这里面的图片带有参数
可以在request前添加
if(this.SourceUrl.Contains("?"))
{
int i = this.SourceUrl.LastIndexOf("?");
this.SourceUrl = this.SourceUrl.Remove(i, this.SourceUrl.Length - i);
}
先感谢durow,正好用上!
--------------------错误如下--------------------------------------
An unhandled exception occurred while processing the request.
InvalidOperationException: Incorrect Content-Type:
Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()
UEditorNetCore.Handlers.ListFileManager.Process()
UEditorNetCore.UEditorActionCollection.ListFileAction(HttpContext context)
UEditorNetCore.UEditorService.DoAction(HttpContext context)
MyXXXProject.Controllers.UEditorController.Do() in UEditorController.cs
....
经查是 /Handlers/ListFileHandler.cs中的Request.Form引起的,修改为Request.Query后问题解决。
升级成Microsoft.AspNetCore 1.1.0后,Response.WriteAsync会导致浏览器出现ERR_CONNECTION_RESET的错误(1.0.3下正常),这个应该是升级后类库导致的,请问有解决方案没?
改为:var localPath = Path.Combine(Config.WebRootPath + UploadConfig.SaveAbsolutePath, savePath);
修改config.json配置:
"imageUrlPrefix": "/ueditor_file/", /* 图片访问路径前缀 /
"imageSaveAbsolutePath": "/ueditor_file/", / 文件保存路径 */
"imageFtpUpload": false, /是否FTP OSS上传/
您好,我不想把上传的文件保存在根目录下,请问该如何配置?
经过调试WebRootPath多于一个文件夹时,就无法保存了,
Path.Combine(Config.WebRootPath, savePath); 此时结果就还是相对路径 /UploadFiles/xxx/xxx.jpg
Path.Combine用法好但其实也有坑
改为:Response.Headers.Add("Content-Type", "text/plain;charset=utf-8");
net::ERR_INCOMPLETE_CHUNKED_ENCODING
问题导致不能上传图片,根本原因是kestrel的问题,换用iis express 调试就可以了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.