How can one automatically rename files uploaded in a webform? I would like to rename the files uploaded to a webform according to some tokens or the value in some other field.

I did some research on this and was surprised to find no definite solution.

For example: 


https://www.drupal.org/node/326738 => A patch supplied for token support but the discussion ends without a final working patch
https://www.drupal.org/node/364752 => Discussion on "Renaming file upload fields using other form fields". Discussion ends in "Won't Fix"
Webform, creating customized directories for uploaded files => Approaches have been suggested here but no final solution given.
The sandbox project is removed as the issue queue get continued, the latest patch has been failed in simpletest, but you can still check this patch