I am trying to create a php script that uploads files into a directory by what the first letter of the file is. I can't even get the file to upload anywhere 🙁 I am trying to upload the file into a tmp directory and then read the first letter of the file and move it to the correct directory.
The debug part comes back as c:\mydirectory\anotherdirectory\thefile.jpg
Here is what i have so far........
<html>
<body bgcolor="#6495ED">
<font color="#0008B">
<?
$ufile = $POST['datafile'];
$name = str_replace(" ", "", $datafile);
$name = str_replace("[", "", $name);
$name = str_replace("]", "", $name);
echo $ufile; // for debugging purposes
$path="tmp/";
if (!file_exists($path . $name)) {
copy($datafile, $path . $name);
echo "<font color='red'>File copied!</font><br><br>";
}
?>
<b>Upload Your files here 🙂</b>
<br>
<form ENCTYPE="multipart/form-data" name="imgupload" method="post" action="uploadtags.php">
<b>File : <input type="file" name="datafile" size=40><br><br>
<input type="submit" value="Upload">
</form>