Documentation > CMS Template API Library > Asset > CreateFromBase64(String,Asset,String)

CreateFromBase64

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

public CrownPeak.CMSAPI.Asset CreateFromBase64(String,Asset,String)


Returns

A new Asset object if it is successful, null if not successful, check context.Error

Parameters

NameDescriptionType
label The name of the asset - must be unique. System.String
saveLocation The folder to store the asset. CrownPeak.CMSAPI.Asset
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.CreateFromBase64("hex.jpg",asset.Parent, base64data);

Connect with Crownpeak