C# 将大型画布数据发送到服务器
我曾尝试将画布数据作为图像发送,但当图像较大时,它不会发送数据,因此我尝试将其作为表单数据发送,但我在接收代码时遇到了困难。codebehind作为htmlinputelementobject接收。我怎样才能收到它?有人能帮忙吗 Html: 阿贾克斯: 代码隐藏:C# 将大型画布数据发送到服务器,c#,ajax,canvas,webmethod,todataurl,C#,Ajax,Canvas,Webmethod,Todataurl,我曾尝试将画布数据作为图像发送,但当图像较大时,它不会发送数据,因此我尝试将其作为表单数据发送,但我在接收代码时遇到了困难。codebehind作为htmlinputelementobject接收。我怎样才能收到它?有人能帮忙吗 Html: 阿贾克斯: 代码隐藏: [WebMethod(EnableSession = true)] public static string Upload(string image) { } 尝试在web.config中调整请求
[WebMethod(EnableSession = true)]
public static string Upload(string image)
{
}
尝试在web.config中调整请求限制:
<system.web>
...
<httpRuntime maxRequestLength="8192" ... />
下面是在web.config中增加json序列化的代码 代码:
听起来您需要修复服务器以接受更大的上传量?除了您建议增加json序列化限制外,还修复了如下问题代码:system.web.extensions>
[WebMethod(EnableSession = true)]
public static string Upload(string image)
{
}
<system.web>
...
<httpRuntime maxRequestLength="8192" ... />
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647"/>
</webServices>
</scripting>
</system.web.extensions>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647"/>
</webServices>
</scripting>
</system.web.extensions>