Skip to content

Some Enhancements for Consideration #1

@coldes

Description

@coldes

...First of all - nice job - a couple of tweaks you might consider

  1. php: make it super clear that a file has not uploaded
    if (empty($_FILES['data']['tmp_name'])) { echo 'ERROR (no file sent)'; die(); }
  2. php: after upload - a text tweak
    echo 'DONE (NEW UPLOAD)';die();
  3. php: give the "no file" download page a similar style as to main page
if (isset($_GET['type']) && $_GET['type'] == 'download')
{
    if (!file_exists($thefiledata) || !file_exists($thefilename))
    {
        echo '<html><head><meta content="width=device-width, initial-scale=1.0" name="viewport"><style type="text/css">*{color:white;font-family:sans-serif;padding:0;margin:0;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}body{width:100%;top:0;position:absolute;background-color:#f90;height:100%;left:0}a{position:absolute;top:0;height:100%;text-align:center;width:100%;text-decoration:none;display:block}a div{position:relative;top:45%;height:auto;text-align:center;width:100%;font-size:2em;text-decoration:none}a span{font-size:70%}</style><title></title></head><body> <a href="./"><div>NO FILE UPLOADED YET<br /><span>CLICK/TAP TO RELOAD PAGE</span></div></a></body></html>';
        exit;
    }
  1. html: extra meta
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="File Share">
  1. icons
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="touch-icon-180x180.png" />

regards, Col

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions