Datei Upload (PHP)

upload.php
<?php
 
if(isset($_FILES['uploaded'])){
  # Define target
  $target = '/srv/www/domain.de/upload/'.basename($_FILES['uploaded']['name']) ;
 
  # print informations for uploaded file
  echo '<pre>';
  print_r($_FILES);
  echo '</pre>';
 
  if (move_uploaded_file($_FILES['uploaded']['tmp_name'],$target)) {
    echo 'OK!';
  }
} else {
  echo '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
  echo 'File: <input name="uploaded" type="file"/><input type="submit" value="Upload"/>';
  echo '</form>';
}
 
?>
scripts/datei.upload.php.txt · Last modified: 2011/12/07 10:39 by daniel
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki