1
Vote

Couple of issues and fixes

description

Hi,

I used this library and it is a real jam. saved me tone of time :)
Here are some modifications that i made to make things better:
  1. File on Dynamics are saved in Base64 encryption so before sending to Azure storage they need to be converted back from base64
I changed RESTHelper.cs line 114 (CreateRESTRequest)

byteArray = Convert.FromBase64String(requestBody);

This way the file is saved correctly on Azure storage.
  1. File names on Azure storage are lost on upload so there are no file prefix, that prevent the browser to open the file with the right application on download from Azure.
i suggest modifing WorkflowActivities.cs line 71 to:

MimeAttachmentHandler.PutAzureBlob(settings, record.Id.ToString() + "_" + filename, body);

This way the name on the blob object has the correct prefix.
  1. I suggest returning the Azure storage URI to the workflow activity so it can be saved in Dynamics CRM for future use.
    I changed BlobHelper.cs PutBlob method to return a string built from the Azure REST response URI that represent the blob object URI
string res = response.ResponseUri.ToString();

Thanks for the effort and best regards,

Gilad

comments