How can I check if a file is a ppt file

Hello,

how can I check if a file is a PwerPoint file without use the next line:
Presentation pres = new Presentation(sourceFile);
and get the “PptReadException” exception ?
thanks,
Roi

Hi Roi,

Well, currently Aspose.Slides for .NET provides a property
to check the source file format using Presentation.SourceFormat property.
However, this can be used after loading the file. To check the file format
before opening the file, we already have an issue registered in our issue
tracking system with issue id: SLIDESNET-34858. This thread is linked with the
issue and you will get a notification once the feature gets supported.

Thanks & Regards,

Hi Roi,

I like to share that Aspose.Slides does offer to
verify the presentation format without even opening the file. Please try
using the following sample code on your end to serve the purpose.

LoadFormat format = PresentationFactory.Instance.GetPresentationInfo(“test.ppt”).LoadFormat;

Please share, if I may help you further in this regard.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-34858) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thanks,


How can I do that now?

Roi

Hi Roi,


You can please try using the following sample code on your end to serve the purpose.

LoadFormat format = PresentationFactory.Instance.GetPresentationInfo(“test.pdf”).LoadFormat;


It will return “LoadFormat.Unknown” for invalid format.

Many Thanks,


Hi,


I got this answer on 12-25-2014, 7:27 AM

What is the new update?

Thanks,

Roi

Hi Roi,

I am sorry, I have not been able to understand your question. I have shared the sample code with you as well to verify the added feature. Is there any thing that I may help you with?

Many Thanks,