html2pdf :- Upload pdf file dierctly to the amazon s3 bucket

左心房为你撑大大i 提交于 2019-12-11 18:49:27

问题


Here is my code i want to upload generated pdf file to amazon s3 bucket.

    $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');

If i do $html2pdf->output(dirname(__FILE__)."/temp_files/some_content-".uniqid().".pdf", 'F'); it will upload to the server folder.

Is there anyway i can upload file directly to amazon-s3 bucket ?

thanks in advance.

来源:https://stackoverflow.com/questions/55293465/html2pdf-upload-pdf-file-dierctly-to-the-amazon-s3-bucket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!