Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateProcessor Error on Load Template #2437

Closed
pietsteph opened this issue Aug 14, 2023 · 0 comments
Closed

TemplateProcessor Error on Load Template #2437

pietsteph opened this issue Aug 14, 2023 · 0 comments

Comments

@pietsteph
Copy link

pietsteph commented Aug 14, 2023

Describe the Bug

My project is using CodeIgniter 3 and I tried to load template from docx file placed in assets folder but it gave me an error. I'm sure that the path is correct, because when I tried to directly access the link generated in "Current Behavior" section, I can access the file (downloaded to my browser).

Steps to Reproduce

$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor(base_url('assets/templates/template_ba_adjust_absence.docx'));

Expected Behavior

Expected to load the docx file from defined path.

Current Behavior

A PHP Error was encountered
Severity: Warning

Message: copy(http:https://localhost:8080/assets/templates/template_ba_adjust_absence.docx): Failed to open stream: Cannot assign requested address

Filename: PhpWord/TemplateProcessor.php

Line Number: 115

Context

Please fill in your environment information:

  • PHP Version: 8.2.5
  • PHPWord Version: 1.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant