I've created a flash form that allows a user to upload a file to my server.
I used this:
<?PHP
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['Filedata']['name']);
if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $target_path))
{
echo "The file ". basename( $_FILES['Filedata']['name']). " has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
?>
I was wondering if there was a way to take the file and make attach it to a mail() statement. So, instead of uploading it, I send the file as an attachment to a mail recipient.