How to get image saved in S3 as byte[]

Hi  

we have Creatio Installed in our environment and confined to saving files in S3 instead of the database, now how I can get a stream of files saved in S3 inside the process script 

I used the below code when I saved the file in the Database :

ar userConnection = Get<UserConnection>("UserConnection");
Guid contactId = new Guid("4177bc0a-8cb1-4895-aacf-5932ed6b4cb5");
string base64String = "";
Select selectEmail = new Select(userConnection)
            .Top(1)
                .Column("Data")
            .From("ContactFile")
            .Where("ContactId").IsEqual(Column.Parameter(contactId)) as Select;
using (var dbExecutor = userConnection.EnsureDBConnection()) {
    using (IDataReader dataReader = selectEmail.ExecuteReader(dbExecutor)) {
        if (dataReader.Read()) {
            byte[] imageBytes = dataReader.GetColumnValue("Data") as byte[];
            base64String = Convert.ToBase64String(imageBytes);
        }
    }
}

can anyone help on how to get the image stream saved in S3?

 

Like 0

Like

1 comments

Hi,

 

You need to try approaches described in Stack Overflow here or in the AWS forum here.

 

Best regards,

Oscar

Show all comments