Ruby API to decrypt cloud Microsoft Excel and OpenOffice Calc spreadsheet with password
Ruby library to decrypt cloud Microsoft Excel and OpenOffice Calc spreadsheet with password
Decrypt cloud Microsoft Excel and OpenOffice Calc spreadsheet with password - Ruby REST API
API Request:
DELETE
https://api.aspose.cloud/v3.0/cells/{name}/encryption
Decrypting a cloud spreadsheet with a password is a complex task. Decrypting a local spreadsheet with password transitions is performed by our Ruby SDK while maintaining the source spreadsheet's main structural and logical content. Our Ruby library is a professional solution to decrypt cloud spreadsheets with a password online. This Cloud SDK gives Ruby developers powerful functionality and perfect API.
Ruby code for decrypting cloud 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
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby | |
require 'aspose_cells_cloud' | |
class Document | |
include AsposeCellsCloud | |
def initialize | |
#Get client_id and client_secret from https://cloud.aspose.com | |
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl) | |
end | |
# Decrypt document | |
def decrypt_document | |
name = $BOOK1 | |
encryption = AsposeCellsCloud::WorkbookEncryptionRequest.new({:Password=>'123456',:KeyLength=>128,:EncryptionType=>'XOR'}) | |
folder = $TEMPFOLDER | |
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) | |
expect(result.uploaded.size).to be > 0 | |
result = @instance.cells_workbook_delete_decrypt_document(name, { :encryption=>encryption,:folder=>folder}) | |
expect(result.code).to eql(200) | |
end | |
end | |
document = Document.new() | |
puts document.decrypt_document |
How to use Ruby 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 cells_workbook_delete_decrypt_document method to get the resultant stream
System Requirements
- ruby 2.5 or newer