# PHP File Upload

**URL:** <https://forum.kirupa.com/t/php-file-upload/85006>\
**Category:** programming\
**Created:** [April 1, 2005, 3:32am UTC](https://forum.kirupa.com/t/php-file-upload/85006 "2005-04-01T03:32:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![A7RSTR7K3](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@A7RSTR7K3](https://forum.kirupa.com/u/A7RSTR7K3)\
**Post date:** [April 1, 2005, 3:32am UTC](https://forum.kirupa.com/t/php-file-upload/85006/1 "2005-04-01T03:32:03Z")

</div>

Ok… well here is the php code that I am running…

```php
<?php
 	$uploadDir = "../upImages";
 	$uploadfile = $uploadDir . $_FILES['upPic']['name'];
 	if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)){
 		echo "upload succesful";
 	} else {
 		echo "failed...";
 	}
 ?>

```

And here is the html page that submits to it…

```auto
<html>
<title>Buy Legends - Picture Upload</title>
<body>
<form name="upPics" enctype="multipart/form-data" action="uploadPicAction.php" method="post">
<input type="file" name="upPic">
<input type="hidden" name="PASS" value="nhy67ujm">
<input type="submit" name="upload" value="upload">
</form>
</body>
</html>

```

Also… as far as permissions have run… I have ran both  
chmod 777 upImages…&  
chmod 766 upImages  
it doesn’t work under either one… Please help.
