Why doesn’t update_post_meta work for certain strings?

Check closely on your line:

With the $path = $upload[‘file’] call I get that $path contains “C:\xampp\htdocs\wordpress/wp-content/uploads/2011/12/ReSharper-6.1-License18.txt”

‘\’ changes to “https://wordpress.stackexchange.com/” just after the ‘wordpress’ i.e. \wordpress/, hence invalidating your path. But when you use a hard coded path (which is not invalid), you get the answer. Try fixing your path first.