简体   繁体   中英

How can I stop Symfony from truncating my POSTed object?

I am using Symfony 2.6 and need to post a rather large amount of data (~95000+ bytes). The posting to the server works fine and I access my posted data in my Symfony controller using

$request->get('myData')

However, only part of the object is actually forwarded to my controller. I can see this on the Symfony profiler which shows me the object and the actual raw posted form-encoded data. The form-encoded data is complete whereas the object just breaks down at some point. So since the server receives all of the data this can not be caused by a PHP POST limit.

This is the format my object has (as formatted by the Symfony Profiler):

[
    0 => [
      firstKey => firstValue0,
      secondKey => secondValue0,
      thirdKey => thirdValue0
    ]
    1 => [
      firstKey => firstValue1,
      secondKey => secondValue1,
      thirdKey => thirdValue1
    ]

    ...etc...

    333 => [
      firstKey => firstValue333,
      secondKey => secondValue333
    ]
]

All of the objects in the array are supposed to have all the same three keys. Also from looking at the raw posted content there should be 800 entries. However, as you can see, Symfony stops interpreting the input at entry 333 and does not even completely interpret this one as it is missing the last key-value pair.

This makes me think that Symfony has a restriction on the amount of input parsing it will do. Does anyone know where I can adjust this limit? Or is there something else that I could be doing wrong?

By default, PHP >=5.3.9 has a 1000 variable maximum for get/post/cookie entries. You can override this in your php.ini file.

max_input_vars = 10000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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