Free Support Forum - groupdocs.com

Check file is password protected


#1

Hi,

We are planning to use groupdocs for conversion, as a part of that we need to convert the password protected files as well.

Before converting the password protected document, we need to check whether the file is password protected or not and if protected we need to prompt user for password.

So my question is what is the way to check a file [ex: office documents] is password protected ?

Regards,
Tirumala Reddy


#2

@annem55,

Thanks for taking interest in GroupDocs.Conversion and posting your concerns.
Can you please confirm if you are evaluating API for Java or .NET platform? We’ll then further investigate this scenario.


#3

Java API. And is there any way to check a file is password protected using java core APIs.


#4

@annem55,

Thanks for the details.

We are investigating this scenario. There could be other Java APIs to detect files encryption but they may not support all the file formats offered by GroupDocs.Conversion for Java API.
Your investigation ticket ID is CONVERSIONJAVA-546. As we have any further update on it, we’ll notify you.


#5

@annem55,

This feature will be added in some future release of the API. We’ll notify you as release gets on-board.


#6

How can we do this using java APIs ? (should work for office documents)


#7

@annem55,

This feature is not yet supported in the API.
But it will be available in some upcoming release. We’ll then update you how you can check if a file is password protected.

Once this feature is released, it will support all these formats.


#8

If the file is password protected, GroupDocs conversionHandler.convert API is throwing GroupDocsException. How do we know whether it is “com.groupdocs.conversion.exceptions.PasswordProtectedException” . or not ?


#9

@annem55,

Whenever you try to process a password protected document. API will always throw following exception:
Exception of type ‘GroupDocs.Conversion.Exceptions.PasswordProtectedException’ was thrown.


#10

I am using java conversion API, and not able to access PasswordProtectedException class at all.

exception class com.groupdocs.conversion.exceptions.c: Exception of type System.Exception was thrown.
com.groupdocs.conversion.domain.documents.q.a(Unknown Source)


#11

Screen Shot 2019-03-07 at 3.31.24 PM.png (12.0 KB)


#12

@annem55,

We are investigating this issue ID: CONVERSIONJAVA-567. As we have any further information, we’ll update you.