I have a page, outside the loop, that display a media attachment with some basic info about it (title, uploaded date, etc). I have the attachment ID available to me via a form submitted before the page loads.
What I need to do is secure the page by making sure that only users who have uploaded that file have access to the page with that file one it. In order to do that, I assumed the easiest way would be to compare the ID of the current, logged-in user with the ID of the user who created the attachment. But there doesn't seems to be a way that I can find to get the ID of the author of a post outside of the loop using only the attachment ID.
I'm stumped, how should I do this?