This isn’t Vikram’s file, but here’s an approach that may help:
Note that that Gregor’s solution in the above thread does involve a bit of JavaScript, but the same concept should be able to be adapted to cover a “File” textfield with another widget or image.