html2pdf:-将pdf文件直接上传到Amazon s3存储桶

时间:2019-03-22 05:35:44

标签: php amazon-s3 html2pdf

这是我的代码,我想将生成的pdf文件上传到Amazon s3存储桶。

    $html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', array(0, 0, 0, 0));
    $html2pdf->pdf->SetDisplayMode('fullpage');

    ob_start();
    if($pdfType === "lease_agreement"){
        include dirname(__FILE__).'/res/somecontent.php';
    }

    $content = ob_get_clean();

    $html2pdf->writeHTML($content);
    $file = dirname(__FILE__)."/temp_files/some_content-".uniqid().".pdf";           
    $html2pdf->output($file,'F');

如果我执行$html2pdf->output(dirname(__FILE__)."/temp_files/some_content-".uniqid().".pdf", 'F');,它将上传到服务器文件夹。

反正我可以直接将文件上传到Amazon-s3存储桶吗?

提前谢谢。

0 个答案:

没有答案
相关问题