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 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题