Add support of pretty url
This commit is contained in:
15
index.php
15
index.php
@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user