Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将大型画布数据发送到服务器_C#_Ajax_Canvas_Webmethod_Todataurl - Fatal编程技术网

C# 将大型画布数据发送到服务器

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中调整请求

我曾尝试将画布数据作为图像发送,但当图像较大时,它不会发送数据,因此我尝试将其作为表单数据发送,但我在接收代码时遇到了困难。codebehind作为htmlinputelementobject接收。我怎样才能收到它?有人能帮忙吗

Html:

阿贾克斯:

代码隐藏:

[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>