Rouji / single_php_filehost

Simple Filehosting Page in a Single PHP File (obvious 0x0 clone)
ISC License
235 stars 35 forks source link

MIME block #18

Closed jamalewd closed 2 years ago

jamalewd commented 2 years ago

how to block .php .apk files?

Rouji commented 2 years ago

Not really documented well, but you can use the EXTERNAL_HOOK

jamalewd commented 2 years ago

how to use it? I don't really understand

const EXTERNAL_HOOK = null; //external program to call for each upload const AUTO_FILE_EXT = false; //automatically try to detect file extension for files that have none

Rouji commented 2 years ago

You can put a path to an executable in there, that'll get called for every upload. Just have a look at the code around line 150

jamalewd commented 2 years ago

You can put a path to an executable in there, that'll get called for every upload. Just have a look at the code around line 150

can you write it down for me? i just want to block .php

Rouji commented 2 years ago

If you're trying to prevent people uploading and executing PHP code, you're doing everything very wrong.

jamalewd commented 2 years ago

so what should i do to prevent others from executing php?

Rouji commented 2 years ago

Configure your webserver so it doesn't handle any files but index.php as executable.