Issue 1:
This looks like a duplicate of a previously fixed issue (#1441) which is occurring for me in 2.1.x-dev beta version (just upgraded to beta 4 today).

In my php.ini upload_max_filesize is set to 2M

When I upload a file > 2M (3.2M in my case) I get

The file "" does not exist 500 Internal Server Error - FileNotFoundException

When I upload any file < 2M I have no issue. I also tried changing my file maxSize assertion to be less than 2M, but that had no effect.

I'll paste the stack trace below. It comes up from my usage of getMimeType() on the file in my preUpload callback

/**
* @ORM\PrePersist()
* @ORM\PreUpdate()
*/
public function preUpload()
{
if (null !== $this->file)
{
// do whatever you want to generate a unique name
$this->path = uniqid() . '.' . $this->file->guessExtension();

$this->mimeType = $this->file->getMimeType();
}
$this->setUpdateTime(time());
}

Here is the stack trace:

Stack Trace 1. in /data/www/bfg_v2/Symfony/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php at line 107 2. at MimeTypeGuesser ->guess ('')  in /data/www/bfg_v2/Symfony/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/File.php at line 79 3. at File ->getMimeType ()  in /data/www/bfg_v2/Symfony/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/File.php at line 58 4. at File ->guessExtension ()  in /data/www/bfg_v2/Symfony/src/CG5/BFG/CoreBundle/Entity/Document.php at line 74 5. at Document ->preUpload ()  in kernel.root_dir/cache/dev/doctrine/orm/Proxies/__CG__CG5BFGCoreBundleEntityDocument.php at line 60 6. at Document ->preUpload ()  in /data/www/bfg_v2/Symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1884 7. at ClassMetadataInfo ->invokeLifecycleCallbacks ('preUpdate', object(Document))  in /data/www/bfg_v2/Symfony/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 947 8. at UnitOfWork ->executeUpdates (object(ClassMetadata))  in /data/www/bfg_v2/Symfony/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 310 9. at UnitOfWork ->commit (null)  in /data/www/bfg_v2/Symfony/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 355 10. at EntityManager ->flush ()  in /data/www/bfg_v2/Symfony/src/CG5/BFG/CoreBundle/Controller/ClassifiedController.php at line 231 11. at ClassifiedController ->updateAction ('10') 12. at ReflectionMethod ->invokeArgs (object(ClassifiedController), array('10'))  in /data/www/bfg_v2/Symfony/vendor/jms/cg/src/CG/Proxy/MethodInvocation.php at line 63 13. at MethodInvocation ->proceed ()  in /data/www/bfg_v2/Symfony/vendor/jms/security-extra-bundle/JMS/SecurityExtraBundle/Security/Authorization/Interception/MethodSecurityInterceptor.php at line 122 14. at MethodSecurityInterceptor ->intercept (object(MethodInvocation))  in /data/www/bfg_v2/Symfony/vendor/jms/cg/src/CG/Proxy/MethodInvocation.php at line 58 15. at MethodInvocation ->proceed ()  in kernel.root_dir/cache/dev/diextra/proxies/CG5-BFG-CoreBundle-Controller-ClassifiedController.php at line 21 16. at ClassifiedController ->updateAction ('10') 17. at call_user_func_array (array(object(ClassifiedController), 'updateAction'), array('10'))  in kernel.root_dir/bootstrap.php.cache at line 1419 18. at HttpKernel ->handleRaw (object(Request), '1')  in kernel.root_dir/bootstrap.php.cache at line 1383 19. at HttpKernel ->handle (object(Request), '1', true)  in kernel.root_dir/bootstrap.php.cache at line 1559 20. at HttpKernel ->handle (object(Request), '1', true)  in kernel.root_dir/bootstrap.php.cache at line 610 21. at Kernel ->handle (object(Request))  in /data/www/bfg_v2/Symfony/web/app_dev.php at line 28

Issue 2:
hinclude() allows dynamic retrieval of a controller's response. What if I want to use the result of this variable multiple times in my twig template?

Option 1

Make multiple calls for the same string:

<div>{{ render_hinclude(controller('AppBundle:App:getString'), {'default': 'Loading'}) }}</div>
Some more data....
<div>{{ render_hinclude(controller('AppBundle:App:getString'), {'default': 'Loading'}) }}</div>

Result: duplicated code.

Option 2

Place the result of this in a variable, and use this variable in multiple places. Doesn't actually work...

{% set var = {{ render_hinclude(controller('AppBundle:App:getString')) }} %}
<div>{{ var|raw }}</div>
Some more data...
<div>{{ var|raw }}</div>

Obviously the above doesn't work because the {{ var }} variables are being looked for on-page-load.