How to upload a file in PHP

In this article I am going to explain file upload in PHP.
  • 1985

PHP file upload

PHP file uploader is used to upload files to the server.

Create an upload-file form

You can create a form for uploading a file .

Example of  upload file form

<html>

 

<body>

 

<form action="date.php" method="post"

enctype="multipart/form-data">

<label for="file">Filename:</label>

<input type="file" name="file" id="file" />

<br />

<input type="submit" name="submit" value="Submit" />

</form>

 

</body>

 

</html>


Output:

upload1.jpg


After browsing a file, output is:

upload2.jpg

After pressing button, output is:

upload3.jpg

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.