PHP only allow certain users access to video files in directory's - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Sunday, April 30, 2023

PHP only allow certain users access to video files in directory's

for my current project i need a folder that contains videos which should only be seeable for registered users, i know that i can block the access via .htaccess file but at least i dont exactly get what i want..

my currently .htaccess file is like this:

Deny from all 

at the moment im importing the videos/pictures through php which works for accessing them but its really really slow..

here is an example for my pictures:

<img src="data:image/png;base64,<?php echo base64_encode(file_get_contents("directory")) ?>">

and here for my videos:

<img src="data:video/mp4;base64,<?php echo base64_encode(file_get_contents("directory")) ?>">

im sure there is a better way where the page doesnt take forever to load, i also tried a video stream with php but i get another problem there, i cant leave the page anymore or again like before it takes forever to click links or leave.. :(

help is much appreciated!



source https://stackoverflow.com/questions/76138453/php-only-allow-certain-users-access-to-video-files-in-directorys

No comments:

Post a Comment