Free Support Forum -

Merge PowerPoint Presentation in PHP using Aspose.Slides REST API intermittently throws 400 Client error


I fixed the problem.
I am now trying to use $slidesApi->mergeOnline.

My problem is this, on average every other time it works, and if it doesn’t it gives me an error like this:
[400] Client error: POST resulted in a 400 Bad Request, “error”:{“code”: “PresentationLoadFailed”, “message”: "Failed to load t (truncated…)

Any idea where this is coming from?

Thank you for your query. Could you share the code example reproducing the error, please?

$config = new Configuration();
$slidesApi = new SlidesApi(null, $config);

$filesToMerge = array();

foreach($files as $file) {

$filesToMerge[] = fopen($path, ‘r’);

$response = $slidesApi->mergeOnline($filesToMerge, null);

It will take me a while to investigate this case. Thank you for your patience.


Can you please provide the presentation file that you are using on your end. The issue may likely be a big presentation giving a time out response is obtained or an issue with API itself while working with presentation. Can you please share the details so that we may verify it further.


In addition to the above reply, we have tested the mergeOnline API with a number of different PPTX files but we are unable to reproduce the issue. So as requested above, please share your sample PPTX files to replicate the issue it may be related to your input PPTX files size or structure.

$files = array("C:/Temp/AccessSlides.pptx", "C:/Temp/test.pptx", "C:/Temp/Slide1.pptx");

$filesToMerge = array();

foreach($files as $file) {
$filesToMerge[] = fopen($file, 'r');

$response = $slidesApi->mergeOnline($filesToMerge);
echo "Completed!!!!";