[Ticket cloned from T6375: Is there any way to add 'comment' type question when dragging 'text' question from toolbox in survey creator?]
Hi Andrew, I am stuck at image type in surveyjs creator. When the actual image width is more than 1200px; it is converting it into base64 string but returns 500 server error when calling a method on server side. Is there any particular restriction on image size or can we show a validation when user uploads an image in the creator which is more than 1200px width? Images less than 1200px width works fine.
Thanks a lot.
Hello,
Could you clarify - what server (surveyjs.io or your own) are you using? What images are you talking about - file question content during run survey or static images selected in SurveyJS Creator during survey construction?
Thanks, Serge
SurveyJS Team
Hi Serge,
I am using my own server method and it's about static image type control selected in SurveyJS Creator. Any image which has original width more than 1200px is causing this issue. It converts in base64 but unable to call server side method. Please check the ajax code used for calling the method here.
And I've attached an image which is 1909x160.
creator.toolbarItems .push({ id: 'save-test', visible: true, title: 'Save Assessment', action: function () { // json with base64 imagelink in creator.text here var obj = { questionStr: creator.text }; $.ajax({ type: "POST", url: "webform1.aspx/SaveQuestionJson", data: JSON.stringify(obj), contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { alert(response.d) }, failure: function (response) { alert(response.d); } }); } });
[System.Web.Services.WebMethod] public static string SaveQuestionJson(string questionStr) { return null; }