dongse3348 2013-04-02 19:41
浏览 14
已采纳

Android中的JSON / PHP数据限制

logsI have a working Android app which sends the following details to a PHP webserver using JSON

"PhoneNumber"
"ContactName"
"CallType"
"CallDate"
"CallDuration"

My app fetches all this detials fine and the php webserver is able to parse and put it into the database as well .

Php parse:

foreach ( $json_output->CallDetails as $contact )
{
    $phonenum = $contact->PhoneNumber;
    $contactnum = $contact->ContactName;
    $calltype = $contact->CallType;
    $calldate = $contact->CallDate;
    $callduration = $contact->CallDuration;
    // Insert into database 
}

When i try to send say 10 Contact details from the phone to the webserver then things work fine . However if i try to send the entire phone logs ( which you can guess can be quite huge 3 ) then nothing gets added to the database .

Hence i assume i am breaching some limit either a JSON sending side limit or PHP reciever side limit . Anyone knows what it is ?

Can someone suggest a workaround . I really dont want to send my JSON data in short bursts of smaller size .

  • 写回答

1条回答 默认 最新

  • duanshan5259 2013-04-02 20:29
    关注

    More than likely, the data being sent via POST is too large for the server to handle. You will need to increase the maximum post size by adding it to your php.ini or .htaccess file.

    .htaccess example:

    php_value upload_max_filesize 20M
    php_value post_max_size       20M
    

    Update: Upon inspection of your phpinfo, it appears that your current service provider is limiting the post_max_size to 8M.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器