How to return file to user contact form php+ajax on my site?
mail($to,$email_subject,$email_body,$headers);
return readfile(polychor_file.pdf);
How to return file to user contact form php+ajax on my site?
mail($to,$email_subject,$email_body,$headers);
return readfile(polychor_file.pdf);
Did you asking about Send Email with Attachment? If yes, then here is a source on how to "Send Email with Attachment" : https://www.codexworld.com/send-email-with-attachment-php/.
If you want to file return :
$attachment_location = "usaflag.gif";
if (file_exists($attachment_location)) {
header("Content-Description: File Transfer");
header("Cache-Control: public");
header("Content-Type: application/octet-stream'");
header("Content-Transfer-Encoding: Binary");
header("Content-Length:".filesize($attachment_location));
header("Content-Disposition: attachment; filename=usaflag.gif");
readfile($attachment_location);
die();
} else {
die("Error: File not found.");
}