Issue #719πŸ’¬ AnsweredOpened Jan 5, 2018by richieteh940 reactions

Respond problem for upload image

Quick answerby artf

there is an error when parsing the response at grapesjs Which error??? Probably just try to change context.Response.ContentType = "text/plain"; with context.Response.ContentType = "application/json";

Read full answer below ↓

Question

I know is an old problem but I have an issue for the respond where I tried to return a response by using asp.net to return a response below is my code(services code to save into directory and return a response): (code in ashx asp.net) context.Response.ContentType = "text/plain"; context.Response.Expires = -1; try { HttpPostedFile postedFile = context.Request.Files[0] as HttpPostedFile; string tempPath = "/uploadImg"; string savePath = context.Server.MapPath(tempPath); string filename = postedFile.FileName; if (!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); } string path =...

Answers (3)

artfβ€’ Jan 5, 2018

there is an error when parsing the response at grapesjs

Which error???

Probably just try to change context.Response.ContentType = "text/plain"; with context.Response.ContentType = "application/json";

richieteh94β€’ Jan 8, 2018

hi @artf the error is I tried changed the context.Response.ContentType = "application/json"; but still get the above error and my response from service is as below the response get by using Fiddler 4. and I would like to check whether the require response as above because it is weird that response...

artfβ€’ Jan 8, 2018

Unexpected token E in JSON at position 0 means your response it's not a valid JSON string (which should start, for instance, with { or [ not E, probably there is an Error...). Check the response in your dev tools and you will see it

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.