<form method="post" action="?upload" enctype="multipart/form-data">
<input type="file" name="file"><input type="submit" value="Submit"></form>
<?
$dir = "upload/";
if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != "" && copy($_FILES['file']['tmp_name'], "$dir/".$_FILES['file']['name'])) echo "ok";
?>
Published in: PHP
Download

Related snippets