简体   繁体   English

使用html表单隐藏值将大文本发送到服务器

[英]send large text to server using html form hidden value

HI all大家好

I need to send an dynamically generated html to server using html form, html can be bigger size at present it is 1MB我需要使用 html 表单将动态生成的 html 发送到服务器,目前 html 可以更大,它是 1MB

I m sending an dynamical generated html to server using form hidden input field.我使用表单隐藏输入字段将动态生成的 html 发送到服务器。 at server side exception is : too large content..服务器端的异常是:内容太大..

The dynamically generated html is used to generate pdf and generated pdf will send back to browser in same request of response.动态生成的 html 用于生成 pdf,生成的 pdf 将在相同的响应请求中发送回浏览器。

How to handle bigger size html which is generated dynamically.如何处理动态生成的更大尺寸的 html。

Please help me out.请帮帮我。

Thanks kumar kasimala.谢谢库马尔卡西马拉。

If you use asp.net you can do like below:如果您使用 asp.net,您可以执行以下操作:

In Web.config file, add在 Web.config 文件中,添加

<httpRuntime maxRequestLength="100000" executionTimeout="360"/>

under <system.web><system.web>

Split it.拆分它。

  1. Try to split the content to multiple inputs.尝试将内容拆分为多个输入。 Your implementation might have problem with that... but that's not too probable你的实现可能有问题......但这不太可能

  2. Split the content to multiple requests and send them with AJAX.将内容拆分为多个请求并使用 AJAX 发送它们。 Collect the responses and be sure to send it in the right order (not all requests at once).收集响应并确保以正确的顺序发送它(不是一次发送所有请求)。 Last request should confirm it's the end and load a page returning the pdf最后一个请求应该确认它是结束并加载一个返回 pdf 的页面

我在你的问题上搜索了一下,并找到了这个页面,上面说帖子大小是由服务器在其配置中设置的,可以通过重置来更改 - http://forums.sun.com/thread.jspa?threadID= 5400480

If you use java:如果你使用java:

Use servlet post method to transfer the data to the server使用servlet post方法将数据传输到服务器

<form method="post" name="sample_form" action="/xxx">
....
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM