captjack on Nostr: #tech #tipstr one easiest way to do crude http media server on LAN NAS with #php cd ...
#tech #tipstr one easiest way to do crude http media server on LAN NAS with #php
cd /folder/mediafiles/ (where u have mp4 or jpeg)
nano index.php n paste below - save n exit then run "php -S 10.10.20.10:5000"
<?php
echo "Here are our files";
$path = ".";
$dh = opendir($path);
$i=1;
while (($file = readdir($dh)) !== false) {
if($file != "." && $file != ".." && $file != "index.php" && $file != ".htaccess" && $file != "error_log" && $file != "cgi-bin") {
echo "<a href='$path/$file'>$file</a><br /><br />";
$i++;
}
}
closedir($dh);
?>
Published at
2024-04-23 00:18:12Event JSON
{
"id": "09fbbad8c7c878fbca47b28b8efe6c4d6593e0a0da42ffc40da98bedea05e291",
"pubkey": "5e5fc1434c928bcdcba6f801859d5238341093291980fd36e33b7416393d5a2c",
"created_at": 1713824292,
"kind": 1,
"tags": [
[
"t",
"tech"
],
[
"t",
"tipstr"
],
[
"t",
"php"
]
],
"content": "#tech #tipstr one easiest way to do crude http media server on LAN NAS with #php \ncd /folder/mediafiles/ (where u have mp4 or jpeg)\nnano index.php n paste below - save n exit then run \"php -S 10.10.20.10:5000\"\n\u003c?php\necho \"Here are our files\";\n$path = \".\";\n$dh = opendir($path);\n$i=1;\nwhile (($file = readdir($dh)) !== false) {\n if($file != \".\" \u0026\u0026 $file != \"..\" \u0026\u0026 $file != \"index.php\" \u0026\u0026 $file != \".htaccess\" \u0026\u0026 $file != \"error_log\" \u0026\u0026 $file != \"cgi-bin\") {\n echo \"\u003ca href='$path/$file'\u003e$file\u003c/a\u003e\u003cbr /\u003e\u003cbr /\u003e\";\n $i++;\n }\n}\nclosedir($dh);\n?\u003e ",
"sig": "e9391c8535d96fa6a4bc0930e8ba5eabd3f40fdd2340b66471aca3894332395917ded2ce6587a731121070d053f7d8fe1a4fafc9a641ae68546d330d0c6a8c33"
}