Detecting the "No file chosen" state in a file input

Hi Mike, this is what I was looking for. But I can’t chose files in Safari using this technique. Any tip? Thanks