저는 php
과 mysql
및 dompdf
으로 웹 사이트를 개발하고 있습니다. 내 양식 중 하나에 버튼이 있습니다. pdf
파일 이상을 이메일로 보내주십시오. (내 로컬 호스트에서 pdf 파일을 생성 할 수 있지만 전자 메일은 보내지 마십시오. 웹 서버에서 pdf를 만들 수는 없지만 전자 메일이 보내집니다 ...)스트림을 열지 못했습니다 : 사용 권한이 거부되었습니다
메시지 I 볼 수 있습니다 : 나는 이메일을받을
$codigoHTML=utf8_decode($codigoHTML);
$dompdf=new DOMPDF();
$dompdf->load_html($codigoHTML);
ini_set("memory_limit","128M");
$dompdf->render();
$pdf = $dompdf->output();
file_put_contents("pdf/pdfgenerados/cotizacionnueva.pdf", $pdf);
echo "Cotización generada";
//<<-------------- Send by email------------>>>
$fileat = "pdf/pdfgenerados/cotizacionnueva.pdf";
$fileat_type="pdf";
$fileatname= "Cotización.pdf";
$emailfrom="[email protected]";
$emailsubject="Cotización";
$emailmessage="------------ Here you have the pdf file... have a nice day";
$emailto="[email protected]";//
$headers = "From: $emailfrom";
$file = fopen($fileat,'rb');
$data = fread($file,filesize($fileat));
fclose($file);
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$data = chunk_split(base64_encode($data));
$data . "nn --{$mime_boundary}--n";
$ok = @mail($emailto, $emailsubject, $emailmessage, $headers);
if($ok) {
echo " <br/><font face=verdana size=2>The file was successfully sent!</font>";
} else {
die("Sorry but the email could not be sent. Please go back and try again!");
}
:
Warning: file_put_contents(C:/Inetpub/vhosts/.../dompdf/lib/fonts/log.htm) [function.file-put-contents]: failed to open stream: Permission denied in C:\Inetpub\vhosts\...\dompdf\include\dompdf.cls.php on line 864
//the mistake in in the `dompdf` class
Warning: file_put_contents(pdf/pdfgenerados/cotizacion.pdf) [function.file-put-contents]: failed to open stream: Permission denied in C:\Inetpub\vhosts\...\list.php on line 116
이 내 코드입니다. 그러나 나는 pdf를 받는다. 파일
무엇을 할 수 있습니까 ???