How to upload a pdf document to the azure blob storage?

We have an application where the excel and word documents that are uploaded into SharePoint are converted into PDF using Aspose.Cells.Cloud.SDK for .NET. These converted PDF documents are then merged into one single PDF. But now, there’s a new requirement that PDF documents uploaded into SharePoint also need to be included in the merged PDF.

We have an if else condition where we check if the extension is .xls or .doc and then convert them to PDF accordingly. But if the extension = .pdf, how can I still upload it into the blob container or storage so that it’s included in the merge?

Any help is greatly appreciated. Thank you in advance.

@s2205,

  1. Create Azure Storage on the dashboard of Aspose Cloud bind your azure blob storage.
  2. Use the UploadFile feature of Aspose.Cells Cloud SDK upload to cloud storage.

Hi @wangtao, thank you for your response. Could you share the code snippet?

Appreciate your time and help.

@s2205,

  1. Login https://dashboard.aspose.cloud/

  2. Enter Create New Storage from the storages page.
    1.png (96.7 KB)
    2.png (76.0 KB)
    3.png (32.3 KB)

  3. Remember your storage name about your Azure storage.

  4. Reference the following code about uploading files.

var path = @“D:\projects\test\Aspose.Cells.Cloud\TestData\source\Book1.xlsx”;
CellsApi instance = new CellsApi(Environment.GetEnvironmentVariable(“ProductClientId”), Environment.GetEnvironmentVariable(“ProductClientSecret”));
Stream file = File.OpenRead(path);
instance.UploadFile(“des.xlsx”, file, “MyAzure”);

@wangtao Thank you so much for the information.

Hi @wangtao, the path in my case is not local but existing in the blob container. These documents are first downloaded onto the azure storage already and I need to upload them to a sub folder. So how can I use this path on azure storage?

@s2205,

If you have two azure storages, you can create two storages on the cloud dashboard to bind your azure storages.

Cell Cloud SDK provides a copy function that can solve the migration of data between two storage spaces.

Please refer to the online document and API reference.

https://apireference.aspose.cloud/cells/#/File