<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">&lt;?php
$picfile = "/var/www/public_html/ws3/pic.jpg";

if(strlen(basename($_FILES["image"]["name"])) &gt; 0){
  $stripped = trim(str_replace(" ","", $_FILES["image"]["name"]));

  if(move_uploaded_file($_FILES["image"]["tmp_name"], $picfile)){
    @chmod($picfile,0755);
    echo "Ok!";
  }else{
    echo "Error copying! ".$_FILES["image"]["tmp_name"]." to ".$picfile." reason:". $_FILES["image"]["error"] ;
  }
}else{
  echo "Error uploading!";
}

?&gt;

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;Web Share Target Demo&lt;/title&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;!-- import the webpage's stylesheet --&gt;
    &lt;link rel="stylesheet" href="./style.css"&gt;
    &lt;!-- Manifest --&gt;
    &lt;link rel="manifest" href="./manifest.json"&gt;
  &lt;/head&gt;  
  &lt;body&gt;
    &lt;h1&gt;
      Img Upload Demo
    &lt;/h1&gt;
    &lt;p&gt;
      &lt;b&gt;href:&lt;/b&gt; &lt;code&gt;&lt;span id="href"&gt;&lt;/span&gt;&lt;/code&gt;
    &lt;/p&gt;
    &lt;p&gt;
    &lt;img src="//demo.com/ws3/pic.jpg&lt;?php echo "?".time(); ?&gt;" width="100%" /&gt;
    &lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre></body></html>