问题 #719💬 已回答提出于 2018年1月5日作者 richieteh940 个反应

上传图片的响应问题

快速解答作者 artf

在解析 grapesjs 的响应时存在错误 哪个错误???? 可能只是试着换个“语境”。Response.ContentType = “text/plain”;'Response.ContentType = “application/json”;'

阅读下方完整回答 ↓

问题

我知道这是个老问题,但我遇到过一个问题,我尝试用 asp.net 来回复回复 以下是我的代码(服务代码,用于保存到目录并返回响应): (ASHX asp.net 代码) '背景。Response.ContentType = “文本/平板”; 背景。响应。过期 = -1; 试试看 { HttpPostedFile postedFile = 上下文。Request.Files[0] 作为 httpPostedFile; string tempPath = “/uploadImg”; 字符串 savePath = 上下文。Server.MapPath(tempPath); string filename = postedFile.FileName; 如果(!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); } string path = savePath + @“\” + 文件名; postedFile.SaveAs(path); Stream s = postedFile.InputStream; Image img = System.Drawing.Image.FromStream(s); 整数 imgHeight = (整)数。物理尺寸。高度; int imgWidth = (int)img。物理...

回答(3)

artf2018年1月5日

在解析 grapesjs 的响应时存在错误

哪个错误????

可能只是试着换个“语境”。Response.ContentType = “text/plain”;'Response.ContentType = “application/json”;'

richieteh942018年1月8日

你好,@artf错误是 ![图片](https://user-images.githubusercontent.com/26899725/34657394-9087a7fc-f460-11e7-802a-7ff5f1226ef1.png) 我试着改变了“语境”。Response.ContentType = “application/json”;',但仍然会出现上述错误 我对服役的回应如下 ![图片](https://user-images.githubusercontent.com/26899725/34657421-c781cba2-f460-11e7-9176-77d35eb6f743....

artf2018年1月8日

在JSON中位置0出现意外令牌E,意味着你的响应不是有效的JSON字符串(例如应该以'{'或'['开头,而不是'E',可能有'Error...')。在你的开发工具里查看回复,你会看到的

相关问答

通过相似的问题讨论继续研究。

与此问题匹配的付费插件

根据问题关键词和标签相关性精选,助你更快交付。

查看全部插件

正在加载付费插件推荐……

免费方案

在以下平台查看开源 GrapesJS 插件: GitHub 或在我们的免费目录中快速搜索。

浏览免费插件 →
高级方案

高级插件提供支持、定期更新和生产就绪的功能——为你节省数天的集成工作。

浏览高级插件 →

相关教程

关于同一主题的深入指南。

全部教程 →

浏览插件分类

直接跳转到市场上的插件分类页面。