Question

PUT request to upload xlsx to Azure Blob Storage

  • 10 January 2023
  • 4 replies
  • 258 views

Badge +2

I am trying to upload an xlsx file to Azure Blob Storage using the REST Web Services action. I have tried setting the Content type to Custom with application/vnd.openxmlformats-officedocument.spreadsheetml.sheet as the type and then adding in the filepath in the parameters/substitution sections but that doesn’t upload the file correctly.

I have also tried using multipart/form-data as the content type and adding in a parameter of type File with the filepath which uploads the file but the content of the file is all scrambled and random characters.

 

How do I upload an xlsx file to Azure Blob Storage using AA?

 

Thanks


4 replies

Userlevel 5
Badge +11

Hi @Matthew 6008 ,

You will be able to upload,

Please find the below,

 

 

 

Userlevel 5
Badge +10

@Matthew 6008  install below packages 

Install-Package Microsoft.Azure.Storage.Blob -Version 11.1.1
Install-Package Microsoft.AspNetCore.StaticFiles -Version 2.2.0
Badge +2

@Matthew 6008  install below packages 

Install-Package Microsoft.Azure.Storage.Blob -Version 11.1.1
Install-Package Microsoft.AspNetCore.StaticFiles -Version 2.2.0

Hi @rbkadiyam 

Can you guide me on where/how I can get these packages?

Badge

@Matthew 6008  install below packages 

Install-Package Microsoft.Azure.Storage.Blob -Version 11.1.1
Install-Package Microsoft.AspNetCore.StaticFiles -Version 2.2.0

Hi @rbkadiyam 

Can you guide me on where/how I can get these packages?

@Matthew 6008  install below packages 

Install-Package Microsoft.Azure.Storage.Blob -Version 11.1.1
Install-Package Microsoft.AspNetCore.StaticFiles -Version 2.2.0

Why do we need to install these pkg’s?

 

I am trying something similar but uploading a jpeg to Azure share. The Content-Length is calculated incorrectly when choosing multipart/form-data so I get an error - 

 

“<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
RequestId:da00e011-801a-0076-15c5-ce648c000000
Time:2023-08-14T15:37:46.2817174Z</Message><HeaderName>Content-Length</HeaderName><HeaderValue>23949</HeaderValue></Error>

Reply