Rename file feature supports? Exception occurs during mail merge feature

  1. I can get a list of available files i.e.
    $folder = new Folder(); $tempStyleAll = $folder->GetFilesList("");
    But is it possible to rename a file using storage api?
  2. Template mail merge feature does not work with Sub-folder document file.
    Url: Create multiple documents at once using MailMerge|Documentation

Source Code:

$xml = simplexml_load_file(getcwd() . “\template\Template.xml”); $mainDocument = “Business Templates//Marketing//Template.doc”; //create WordMailMerge object $doc = new WordMailMerge(); $result = $doc->ExecuteTemplate($mainDocument, $xml->asXML());

Exception Details

Fatal error: Uncaught exception ‘Exception’ with message ‘No file name specified’ in D:\Projects\AppServ\www\csbbdemo\Saaspose.SDK-for-PHP-master\Words\MailMerge.php:120 Stack trace: #0 D:\Projects\AppServ\www\csbbdemo\index.php(16): WordMailMerge->ExecuteTemplate(‘Business Templa…’, ‘<?xml version="…’) #1 {main} thrown in D:\Projects\AppServ\www\csbbdemo\Saaspose.SDK-for-PHP-master\Words\MailMerge.php

Submitted from: http://saaspose.com/

Hi,

  1. Yes, it is possible. Please check the PHP REST example at Working with files and directories in cloud storage|Documentation

  2. Sorry, this was a bug with ExecuteTemplate method. Now this method has been updated to handle sub-folders. Please download latest SDK or MailMerge.php from GitHub - aspose-words-cloud/aspose-words-cloud-php: A PHP library for communicating with the Aspose.Words Cloud API and update your code like the following:

$xml = simplexml_load_file(getcwd() . "\\template\\Template.xml");
$mainDocument = "Template.doc";
//create WordMailMerge object
$doc = new WordMailMerge();
$result = $doc->ExecuteTemplate($mainDocument, $xml->asXML(), "Business Templates/Marketing");

Note: Make sure “Template.doc” is uploaded in “Business Templates/Marketing” folder of the Saaspose storage.

Please feel free to contact us in case you have further comments or questions.

Best Regards,
Muhammad Ijaz
Support Developer, Saaspose Sialkot Team
http://www.saaspose.com

Hi,

Did the last suggestion and code sample from our support team worked for you? Are you good to move forward with Saaspose API? If you need any further assistance, please do let us know. We'll be glad to help you.

Thanks & Regards
Shahzad Latif
Saaspose Support Team.