PHP API to decrypt local Microsoft Excel and OpenOffice Calc spreadsheet with password
PHP library to decrypt local Microsoft Excel and OpenOffice Calc spreadsheet with password
Decrypt local Microsoft Excel and OpenOffice Calc spreadsheet with password - PHP REST API
API Request:
POST
https://api.aspose.cloud/v3.0/cells/unlock
Decrypting a local spreadsheet with a password is a complex task. Decrypting a local spreadsheet with password transitions is performed by our PHP SDK while maintaining the source spreadsheet's main structural and logical content. Our PHP library is a professional solution to decrypt local spreadsheets with a password online. This Cloud SDK gives PHP developers powerful functionality and perfect API.
PHP code for decrypting local spreadsheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('vendor\autoload.php'); | |
use \Aspose\Cells\Cloud\Api\CellsApi; | |
use \Aspose\Cells\Cloud\Request\PostUnlockRequest; | |
class Workbook { | |
public $cells; | |
public function __construct() { | |
$this->cells = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"),"v3.0",getenv("CellsCloudApiBaseUrl")); | |
} | |
public function runCloudAPI() { | |
$needUnlockXlsx = "needUnlock.xlsx"; | |
$sourcePath = 'TestData/'; | |
$mapFiles = array (); | |
$mapFiles[$needUnlockXlsx] = $sourcePath.$needUnlockXlsx; | |
$request = new PostUnlockRequest(); | |
$request->setFile( $mapFiles); | |
$request->setPassword( "123456"); | |
$this->cells->postUnlock($request); | |
} | |
} | |
$workbook = new Workbook(); | |
$workbook->runCloudAPI(); | |
?> |
How to use PHP API to decrypt
- Create an account at Dashboard to get free API quota & authorization details
- Initialize CellsApi with Client Id, Client Secret, Base URL & API version
- Call postUnlock method to get the resultant stream
System Requirements
- PHP 7.4 or newer