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

Free Support Forum - aspose.com

UnsupportedFileFormatException: Unsupported file format: Unknown

Hi ,

I am getting below exception while loading the file.
com.aspose.words.UnsupportedFileFormatException: Unsupported file format: Unknown
at com.aspose.words.zzGS.zzZ(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.tarento.framework.util.AsposeUtil.getDocument(AsposeUtil.java:75)
at com.tarento.framework.util.AsposeUtil$$FastClassBySpringCGLIB$$f5ea8f2f.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:58)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at com.tarento.framework.util.AsposeUtil$$EnhancerBySpringCGLIB$$4f1f335.getDocument()

This is code snippet :
File file = new File(“D:/documet_test.docx”);
InputStream inputStream = new FileInputStream(file)
Document document = new Document(inputStream);

Thank you…
documet_test.zip (12.6 KB)

@Pintutrnt

We have tested the scenario using the latest version of Aspose.Words for Java 19.11 and have not found the shared issue. So, please use Aspose.Words for Java 19.11.