Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php upload file

<?php
$filename = basename($_FILES['myfile']['name']);
if (move_uploaded_file($_FILES['myfile']['tmp_name'], "files/$filename")) {
  echo "File uploaded";
} else {
  echo "An error occurred";
}
?>
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post" enctype="multipart/form-data">
  <label>File: <input type="file" name="myfile" /></label>
    <input type="submit" value="send" />
  </form>
Source by wiki.weeklyd3.repl.co #
 
PREVIOUS NEXT
Tagged: #php #upload #file
ADD COMMENT
Topic
Name
8+2 =