Knowledge Base

Find answers to common questions about Cloudmersive products and services.



Azure Blob Cloud Storage Virus Scan with Complex File Names
7/1/2022 - Cloudmersive Support


When using the Cloudmersive Cloud Storage Scan APIs to scan Azure Blob resource paths, special characters may be included in the file name. This can cause a 400 Bad Request error because the file name is passed in through an HTTP Header, and HTTP Headers do not allow certain special characters to be used.

To address this, you can base64 encode the input file path when calling the Cloudmersive Cloud Storage Scan API for Azure Blob. The API will automatically detect base64 encoded input and decode it as needed, and then perform the scan normally. All major programming languages support base64 encoding.

As a simple example, here is a line of code in C# that will base64 encode the input file name:

var temp = System.Text.Encoding.UTF8.GetBytes(input);
string base64encoded = System.Convert.ToBase64String(temp);

In Power Automate and Azure Logic Apps you can base64 encode a value by using the base64() expression.

800 free API calls/month, with no expiration

Get started now! or Sign in with Google

Questions? We'll be your guide.

Contact Sales