猿问

如何修复“file_get_content”无法打开流

我正在使用cups-ipp从网络项目打印


我得到了这个错误


file_get_contents(./helloworld.pdf):无法打开流:没有这样的文件或目录


我试图从存储中获取文件但遇到了同样的错误


        $builder = new Builder();


        $responseParser = new ResponseParser();


        $printerManager = new PrinterManager($builder, $client, $responseParser);

        $printer = $printerManager->findByUri('ipp://localhost:631/printers/HP_HP_ColorLaserJet_MFP_M278-M281');


        $jobManager = new JobManager($builder, $client, $responseParser);

        $filePath = '../../../storage/app/public/estimated_dates.pdf';


        $job = new Job();

        $job->setName('job create file');

        $job->setUsername('demo');

        $job->setCopies(1);

        $job->setPageRanges('1');

        $job->addFile('./helloworld.pdf');

        $job->addAttribute('media', 'A4');

        $job->addAttribute('fit-to-page', true);

        $result = $jobManager->send($printer, $job);

我链接了存储,我确定路径是正确的(我也使用过auto complete path plugin)


料青山看我应如是
浏览 101回答 1
1回答
随时随地看视频慕课网APP
我要回答