Php 服务器上的文件权限错误
我正在为Php 服务器上的文件权限错误,php,codeigniter,download,sendmail,host,Php,Codeigniter,Download,Sendmail,Host,我正在为codeigniter使用send grid。我的目标是发送pdfmail 遇到未捕获的异常 类型:Guzzle\Common\Exception\InvalidArgumentException 消息:无法打开进行阅读 文件名:opt/lampp/htdocs/projectdemo/webusa/application/third_party/sendmail/vendor/guzzle/guzzle/src/guzzle/Http/Message/PostFile.php 电话号码
codeigniter
使用send grid
。我的目标是发送pdf
mail
遇到未捕获的异常
类型:Guzzle\Common\Exception\InvalidArgumentException
消息:无法打开进行阅读
文件名:opt/lampp/htdocs/projectdemo/webusa/application/third_party/sendmail/vendor/guzzle/guzzle/src/guzzle/Http/Message/PostFile.php
电话号码:53
我的PHP代码:-
$pdfFilePath = HOSTNAME."uploads/files/ash.pdf";
$this->sendMail($to, $subject, $message , $pdfFilePath );
您不能使用
HTTP
路径访问文件。将其更改为绝对路径,如下所示
root_directory/path/to/file/residing/ash.pdf
eg(local machine): D://my_folder/myfiles/ash.pdf
eg(live server): /public_html/myfiles/ash.pdf
您不能使用
HTTP
路径访问文件。将其更改为绝对路径,如下所示
root_directory/path/to/file/residing/ash.pdf
eg(local machine): D://my_folder/myfiles/ash.pdf
eg(live server): /public_html/myfiles/ash.pdf
当试图将文件发布到远程位置时,Guzzle要求该文件为本地文件。您应该在
http://website.com/projectdemo/webusa/uploads/files/ash.pdf
然后上传
如果您不想将整个文件下载到一个临时位置,然后将其上载回,一个可能的解决方案是使用streams
我们也来看看这个讨论:
http://website.com/projectdemo/webusa/uploads/files/ash.pdf
然后上传
如果您不想将整个文件下载到一个临时位置,然后将其上载回,一个可能的解决方案是使用streams
我们也来看看这个讨论:
$pdfFilePath = APPPATH."uploads/files/ash.pdf";
$pdfFilePath = base_url()."uploads/files/ash.pdf";
如果在应用程序文件夹之外
$pdfFilePath = APPPATH."uploads/files/ash.pdf";
$pdfFilePath = base_url()."uploads/files/ash.pdf";
试试这个
如果在应用程序文件夹内
$pdfFilePath = APPPATH."uploads/files/ash.pdf";
$pdfFilePath = base_url()."uploads/files/ash.pdf";
如果在应用程序文件夹之外
$pdfFilePath = APPPATH."uploads/files/ash.pdf";
$pdfFilePath = base_url()."uploads/files/ash.pdf";
是否在根目录中上载??或者在应用程序文件夹内??root/application/uploads/fileCheck我的答案下面是在root中上载的??或者在应用程序文件夹中??root/application/uploads/fileCheck My answer below文件在此链接上下载,但在发送邮件时出错。以及这个文件也在网页上阅读。该文件应为本地文件。您需要在脚本运行的文件系统中下载该文件,以便将其附加到邮件中。该文件在此链接上下载,但在发送邮件时出错。以及这个文件也在网页上阅读。该文件应为本地文件。您需要在脚本运行的文件系统中下载该文件,以便将其附加到消息中。Show me
$pdfFilePath
value Show me$pdfFilePath
value