We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Error in API response on POST to /slides/{name}/Png

When sending a POST to /slides/{name}/Png requesting PNGs of a presentation, the response can be a PNG or a ZIP file - depending on the source file. This is an inconsistent API.

Recently, this changed such that the response is a PNG file if the presentation has 1 slide/page only but a ZIP file of the presentation has more than one slide/page.

On top, the Header of the response still indicates that the response is a ZIP file. See last line of the example header:

    Server: Kestrel
    Strict-Transport-Security: max-age=2592000
    Date: Tue, 05 Jul 2022 07:52:12 GMT
    Access-Control-Expose-Headers: Content-Disposition
    Content-Length: 2596
    Content-Type: application/octet-stream
    Content-Disposition: attachment; **filename=16-10_1page.zip; filename*=UTF-8''16-10_1page.zip**

This is an inconsistent response.

It can’t be expected that the requesting service knows about the number of pages in the document.
We actually don’t know and we don’t want to send another request upfront to get the information such that we know what to expect from the above API call. That’s why we rely on the response Header to give such information correctly.

This is easy to reproduce:

  • Upload the two powerpoint files in the attached Testdata.zip (42.7 KB) file. One has 1 page, the other one 2 pages
  • POST to /slides/{name}/Png
    for each of the files
    Check the response:
  • For the single page powerpoint file, the response is a PNG file even though the Header says it’s a ZIP file
  • For the two page file, the response is a ZIP file.

@nimagnaag,
Thank you for describing the issue.

I’ve reproduced the problem with the inconsistent response when converting the presentation slides to PNG images and added a ticket with ID SLIDESCLOUD-1520 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when the issue is resolved.

1 Like

@Andrey_Potapov - any update on this?

@nimagnaag,
As far as I can see, the issue has already been resolved. A fix will be included in version 22.7.

The issues you have found earlier (filed as SLIDESCLOUD-1520) have been fixed in Aspose.Slides Cloud 22.7. You can check all fixes on the Release Notes page.