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

Free Support Forum - aspose.com

Search media files and check its size in PPTX

Hello Team,

We are using Aspose slides Java version:8.6.0

We have a requirement to block upload of pptx with huge media files.

Is it possible to recognize the media files in pptx and check the size of these media files so that we can block the pptx upload? Please provide solution for this requirement.

Thank you for the query. It will take me a while to prepare the information for you. I will answer as soon as possible.

You can check the size of the media files as shown below:

var presentation = new Presentation(filePath);

for (var image : presentation.getImages())
   var imageSize = image.getBinaryData().length;
   // check the image size here

for (var audio : presentation.getAudios())
   var audioSize = audio.getBinaryData().length;

   // check the audio size here

for (var video : presentation.getVideos())
   var videoSize =  video.getBinaryData().length;

   // check the video size here

I recommend you to use the latest version of Aspose.Slides.

Documents: Shape Types
API Reference: IPresentation interface

1 Like

I have a power point file containing images and it has gotten too big for emailing and I need to decide which slides to cut out. But how can I tell which slides are consuming all the space? There could be just a few slides containing over-large images,but how do i know which slides they are (http://pritikumari.000webhostapp.com/prit)? is there any way to know the file size of individual slides? Publishing all slides to an empty folder creates as many presentations as slides you have. Each new presentation stands for one slide and its Windows Explorer file size shows you which slide has the biggest pictures/audio/video.


I suggest you to please share the complete presentation with us. You can upload it on some file server or Google drive and Dropbox and share the download link with us.