Lets say the image and video urls are:
example.com/img/777.jpg
example.com/vid/888.mp4
but I don't want to create a direct link inside HTML and other frontend (like android app etc).
Are there any disadvantages using:
example.com/getfile.php?type=img&name=777.img
and
example.com/getfile.php?type=vid&name=888.mp4
and inside getfile.php
header('Location: https://example.com/' . $_GET['type'] . '/' . $_GET['name']);
?
Because I don't see any, it looks like it works just like it would be with direct link to the file, also caching is working.
So is there something I should look out for?
I already tried this: Output an Image in PHP but there I have trouble playing videos, it looks like they only start playing after the whole file is loaded