0

hi everyone i am uploading multiple files with different names,so sometimes i want to upload a single
file within that form how do i handle that with php script.Can someone help me with php script that will allow you to upload name or picture ,or sometimes upload both at the same time using these form.

<form action="file-upload.php" method="post" enctype="multipart/form-data">
  Send these files:<br />
  <input name="name[]" type="file" /><br />
  <input name="pictures[]" type="file" /><br />
  <input type="submit" value="Send files" />
</form> 

php script
<?php
   $target = $_POST['path'];
   $fileone = $_FILES['name']['name'];
   $filetwo = $_FILES['picture']['name'];
    $Tdate = date('dFY');
   $path= "/home/myfiles/".$Tdate."/".basename($_FILES['upload']['name']) ;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'],$destfile))
		{
                  
			echo "copied succesfully to ".$destfile."<br/>";
		}
	        else
		{
			echo "failed to copy<br/>";
		}
?>
3
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by Unrealx_
0

This script is correct somehow..but do you mean random names to each of the files??

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.