doutu6658 2012-10-10 09:43
浏览 16
已采纳

too long

I am passing the following data through url :

<?php    
   $url = "generate_pdf.php/?feed=" . urlencode(serialize($result));    
   echo '<div id="left-sidebar">';
   echo '<a href="' . $url . '"><div id="pdf">Download PDF</div></a>';
   echo '</div>';
?>

Here the $result containing the rss feed data in form of array. I am using urlencode(serialize($result) for passing that data through url and its working perfectly on local machine but in server it showing the following error :

Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.

Please tell me your views to deal with this problem.

  • 写回答

2条回答 默认 最新

  • du7535 2012-10-10 10:06
    关注

    I made this mistake (It was more than not knowing than making a mistake!) once. I've build an ajax engine for webapps. It used only the get method. Once I had a form with a lot of data and it did not work.

    After some research I found out this: look here

    So basically most browser does not make any problems because they support approximately 100.000 characters. But most web-servers like Apache only support 4000 characters from a URL.

    No you can not just configure Apache to accept more. It is possible do but you have to edit the source code to do so.

    solution: Use the POST method it is made for large data transfer between web-servers and clients(which are most likely browsers).

    In your case I think you want to create a pdf with some user input an for some reason that input is larger than 4000 characters.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题