I have made an upload form and PHP code to save file upload
HTML:
<HTML>
<head>
<title></title>
</head>
<body>
<form action='upload.php'method="post"enctype="multipart/formdata">
<input type="file" name="file" size="100000" />
<Br />
<input type="submit" value="Upload File" />
</form>
</body>
</HTML>
PHP:
<?php
if( $_FILES['file']['name'] != "" )
{
copy( $_FILES['file']['name'], __DIR__ ) or
die( "Could not copy file!");
}
else
{
die("No file specified!");
}
?>
<html>
<head>
<title>Uploading Complete</title>
</head>
<body>
</body>
</html>
I've changed my code to the form of tutorialspoint php pdf,but still have a problem:
Warning: copy(111.jpg): failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\upload.php on line 4