Documentation > CMS Template API Library > Asset > UpdateFromBase64(String)

UpdateFromBase64

Update a binary (uploaded asset) from a base64 string.

public System.Bool UpdateFromBase64(String)


Returns

True if updating is successful, false if not successful, check context.Error

Parameters

NameDescriptionType
base64String The file bytes as a base 64 encoded string. System.String

Code Example

C#

Sample:
<%=

	Asset data = Asset.Load("/Site/scripts/data");
    string base64data = data["data_base64"];
     
    asset.UpdateFromBase64(base64data);
    if (!string.IsNullOrWhiteSpace(context.Error))
    Out.WriteLine("Update Failed: " + context.Error);

%>

Connect with Crownpeak