What are "query strings" in files?

Asked

Viewed 41 times

0

I am learning PHP and watching a file link 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 a Cloud Front exclusivity or if it is something I can implement with PHP on a common server?

Obg.

1 answer

1

If you refer to the "Expires" key, probably this 1454618820 is only a timestamp stating what time the file will expire, and you cannot access without this key because the site does a check if this key exists.

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

Easily you can implement this on a common server, for example, you can do this:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.