Hi, if I have few files (xlsx) in a folder on my computer (file's name is known), and I want to give the path of the folder in my form using a textbox,

<input type="text" name="path" id="path" >

and for the files to be uploaded to a specific folder on the server so I can use them with php, how can I do that?
I know how to upload files with <input type="file"..>
this is my code for uploading a single file like that:

if ($_FILES['docfile1']['name']!='') {
	$target = 'importFiles/';    
	$target = $target . basename($_FILES['docfile1']['name']);
	if ($target =="import/myfile.xlsx"){
		if (file_exists($target))
			unlink($target);
		if (move_uploaded_file($_FILES['docfile1']['tmp_name'], $target))   {			echo 'success';
		}else{
			echo 'fail';  		
		}
	}else{
	         echo 'fail';
	}
}

I'm trying to change this code so that I can use the path of the folder instead of the input file, but how can I get the $_FILES? I can't figure it out..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.