My IIS ASP.NET-based website allows users to download a file. I'm trying to figure out a good way to stamp an ID into the file before/as the user downloads it so each user could potentially have a uniquely stamped file.
Finding the offset and writing the bytes to the file isn't the hard part. What I'm trying to figure out is what to trigger on so my write procedure could be called, and some way to manage multiple users downloading the same file (I'm assuming writing the file to a unique temp folder, stamp it, then download).
Suggestions?
Bonus: Some of these files will be executable files which were code signed. Stamping will invalidate the digital signature, so I'll need to sign them again after stamping. Thoughts on how best to do that? (I assume fetching a timestamp during the signing process will take too long, so will have to sign without the timestamp).