What are query strings in files?

0

I'm learning PHP and looking at the link from a file on the cloud front I see the following: "(...) cloudfront.net/v/2462380.mp4?Expires=1454618820 (...)"

When I try to access the file without these "keys" the server does not return the file.

I would like to know how this "authentication" is done and if this is an exclusive of Cloud Front or if it is something that I can implement with PHP on a common server?

Obg

    
asked by anonymous 04.02.2016 / 19:41

1 answer

1

If you refer to the "Expires" key, this 1454618820 is only a timestamp stating what time the file expires, and you can not access without this key because the site checks to see if this key exists.

The correct term for these keys is exactly the query strings. Information you pass through the URL.

You can easily implement this on an ordinary server, for example, you can do this:

if(isset($_GET['Expires']) && $_GET['Expires'] >= time()){
     //permite o acesso
}else
    //não permite o acesso.
    
06.02.2016 / 13:16