Read Protection Properties Introduction
Aspose.Slides Cloud allows you to check whether a presentation is password protected. The method below can be invoked with or without a password parameter. If the password is not specified, some properties in the response will not be available.
GetProtectionProperties
API
Type
Description
Resource
/slides/{name}/protection
GET
Reads protection properties of a presentation.
GetProtectionProperties
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of the presentation file.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to the folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder
.
In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.
Examples
Check if the MyPresentation.pptx document is encrypted.
cURL Solution
SDK Solutions
C#
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
ProtectionProperties protectionProperties = api . GetProtectionProperties ( "MyPresentation.pptx" );
if ( protectionProperties . IsEncrypted . Value )
Console . WriteLine ( "The presentation is protected." );
Java
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
ProtectionProperties protectionProperties = api . getProtectionProperties ( "MyPresentation.pptx" , null , null , null );
if ( protectionProperties . getIsEncrypted ())
System . out . println ( "The presentation is protected." );
PHP
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
$config = new Configuration ();
$config -> setAppSid ( "MyClientId" );
$config -> setAppKey ( "MyClientSecret" );
$api = new SlidesApi ( null , $config );
$response = $api -> getProtectionProperties ( "MyPresentation.pptx" );
if ( $response -> getIsEncrypted ())
print ( "The presentation is protected." );
Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
api = SlidesApi . new ( configuration )
response = api . get_protection_properties ( "MyPresentation.pptx" )
if response . is_encrypted
puts "The presentation is protected."
end
Python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
configuration = Configuration ()
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
api = SlidesApi ( configuration )
response = api . get_protection_properties ( "MyPresentation.pptx" )
if response . is_encrypted :
print ( "The presentation is protected." )
Node.js
const CloudSdk = require ( "asposeslidescloud" );
const api = new CloudSdk . SlidesApi ( "MyClientId" , "MyClientSecret" );
const response = await api . getProtectionProperties ( "MyPresentation.pptx" );
if ( response . body . isEncrypted )
console . log ( "The presentation is protected." );
Go
cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
response , _ , e := api . SlidesApi . GetProtectionProperties ( "MyPresentation.pptx" , "" , "" , "" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
if response . GetIsEncrypted () {
fmt . Printf ( "The presentation is protected." )
}
C++
Perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my %parameters = ( name => "MyPresentation.pptx" );
my $response = $api -> get_protection_properties ( %parameters );
if ( $response -> { is_encrypted }) {
print ( "The presentation is protected." );
}
Swift
SDKs
The Aspose.Slides for Cloud SDKs can be downloaded from the following page: Available SDKs .