At the moment, I'm just writing the uploaded file to a directory on my server.
Code: Select all
<?php
$target_path = "";
$target_path = $target_path . basename( $_FILES['uploadFile']['name']);
if(move_uploaded_file($_FILES['uploadFile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadFile']['name']).
" has been uploaded";
} else{
echo "Error!";
}
?>Code: Select all
<?php
$emailAddress = $_POST['email'];
$me = "me@domain.com";
$headers = "From: $emailAddress";
mail($me, "Some Subject", "Some body", $headers);
?>I did consider saving the file to a directory, then email a link to the file, but I don't really want to keep the file stored when it doesn't need to be for security reasons.
If anyone would mind helping me out, I would be very grateful.