wall.deblan.org/download.php

13 lines
340 B
PHP

<?php
require_once 'functions.php';
if (hasValidGetDatas()) {
header("Content-disposition: attachment; filename=".$_GET['code'].'.'.(($_GET['extension']) ? slugify($_GET['extension']) : 'txt'));
header("Content-Type: application/force-download");
readfile('datas/sources/'.$_GET['code']);
die();
}
header('Location: /');