tinybox

Code for file upload software on up.concealed.world.
git clone git://git.concealed.world/tinybox
Log | Files | Refs | README | LICENSE

commit fb3b17613ffd199271481c586224fcc820b3e976
parent d9d0546007c23e01c6255a31e3be2669cb4eddc7
Author: Nixx <nixx@firemail.cc>
Date:   Thu, 10 Feb 2022 17:22:59 +0000

Automatically get URL

Diffstat:
Mindex.php | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/index.php b/index.php @@ -16,10 +16,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -$url = "http://up.concealed.world"; $destdir = "/file/"; $maxsize = 12 * 1024 * 1024; // 12 MB +$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; +$url = $protocol.$_SERVER['HTTP_HOST']; + if($_FILES){ $origname = $_FILES['upload']['name']; $ext = strtolower(substr($origname, strripos($origname, '.') + 1));