web 2.0

How to use PHP & Upload File

How to use PHP & Upload File This the guideline/example a php scripts how to use PHP and Upload file to the Server.

ShotDev Focus:
- PHP & Upload file

Example

php_upload1.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form action="php_upload2.php" method="post" name="form1" enctype="multipart/form-data">
<input type="file" name="fileUpload">
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>

php_upload2.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?
if(copy($_FILES["fileUpload"]["tmp_name"],"shotdev/".$_FILES["fileUpload"]["name"]))
{
echo "Copy/Upload completed.";
}
?>
</body>
</html>

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_upload1.php

Screenshot

PHP Upload file

PHP Upload file

PHP Upload file
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.