Method PUT was changed. 

 Function tmpfile has problem with file handle during execution a lot of requests, so 'fwrite' function gets false instead of resource.