Forum


Replies: 5   Views: 183
How to use google cloud storage to save the document instead of saving it locally
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by jonjie  · 20-12-2023 - 06:36

How to use Google Cloud Storage to save the document instead of saving it locally?

I currently have this code below where I am saving it locally, but I want to directly save it in GCS instead.

$newDocx->searchAndReplace($docxFromPath, public_path() . '/storage/agreements/docx' . $fileName, 'Company Name', 'Apple', $options);

 

Posted by jonjie  · 21-12-2023 - 16:05

Sorry but, what if I want to instead use the `replaceVariableByText()` method instead of searchAndReplace? https://www.phpdocx.com/api-documentation/templates/replace-variable-text-Word-document

Posted by admin  · 21-12-2023 - 16:40

Hello,

What version and license of phpdocx are you using?

in-memory documents and zipstream are compatible with the CreateDocxFromTemplate class, that includes the replaceVariableByText method. On https://www.phpdocx.com/documentation/cookbook/in-memory-docx-documents you can read the methods an classes that support working with in-memory documents.

Regards.

Posted by jonjie  · 21-12-2023 - 17:22

I am using the advanced license.

Posted by admin  · 21-12-2023 - 18:15

Hello,

in-memory documents and zip streams features are available only in Premium licenses. To use these features, please upgrade your license to Premium on MY PHPDOCX page after login.

Regards.