I'm trying to gain access to a file on a client computer so that i can then later attach it to an outgoing email (resume.pdf)
Ive found a few clips of code but I'm having trouble getting it to work for me.
the code below seems to demonstrate all the things ill need to gather about my file but i can't quiet seem to get it to work yet.
does anyone have any idea what im doing wrong?
html code:
<input id="resumeup" name="resumeup" type="file"/>
php code:
$_FILES = $_POST["resumeup"];
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
}