Add support of pretty url

This commit is contained in:
Beu
2019-10-23 17:22:25 +02:00
parent f27d42a92a
commit f2ba5a4d7f
3 changed files with 18 additions and 6 deletions

View File

@ -23,6 +23,17 @@
}
if (_PRETTY_URL === true)
{
$downloadurl = _HTTP_PROTO . '://' . _HTTP_DOMAIN . _HTTP_PATH ;
$uploadurl = $downloadurl ;
}
else
{
$downloadurl = _HTTP_PROTO . '://' . _HTTP_DOMAIN . _HTTP_PATH . 'index.php?id=' ;
$uploadurl = _HTTP_PROTO . '://' . _HTTP_DOMAIN . _HTTP_PATH . 'index.php?name=my_file' ;
}
// Upload File
if ($_SERVER['REQUEST_METHOD'] === 'PUT')
{
@ -50,7 +61,7 @@
if ($filesize < _SIZE_LIMIT )
{
print(_HTTP_PROTO . '://' . _HTTP_DOMAIN . _HTTP_PATH . 'index.php?id=' . $rnd_data );
print($downloadurl . $rnd_data );
}
else
{
@ -93,7 +104,7 @@
{
if (stristr($_SERVER["HTTP_USER_AGENT"], 'curl') or stristr($_SERVER["HTTP_USER_AGENT"], 'Wget'))
{
print("To upload file, use # curl --upload-file my_file " . _HTTP_PROTO . '://' . _HTTP_DOMAIN . _HTTP_PATH . "index.php?name=my_file\n");
print("To upload file, use # curl --upload-file my_file " . $uploadurl);
}
else
{