I'm brand new to AWS, and am trying to get a prototype working from the example code at CloudFront Signed URLs in PHP.
It all works as shown, but moving forward I'm confused about how to deal with a link that has expired. If the resource is an image, then the valid link will return that image and is displayed, but if the URL has expired, it returns XML that says as much. Very nice for example work, but if the URL is used within an IMG tag, then it only shows a broken image.
Is there a way to test the expiration status of a link before using it? Checking the contents of the returns seems reasonable for something small like an image, but what if it's a 1GB video?
In my real world, the url will point to a video resource at AWS. If the link is passed along to an somebody else after it has expired, I want to do some error processing and display some information. I apologize for the vagueness,but I'm still learning the AWS lingo, and I can only describe the problem as I see it.
You could either do an Http HEAD request or decode the policy.
Sample code: http://aws.amazon.com/code/3052