Hi
I'm using code in an ASP.NET web form project to preview documents, but I get an error when running the code in google chrome;
Could not load file or assembly 'SourceCode.HostClientAPI' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Please help.
See code below;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SourceCode.SmartObjects.Client;
using SourceCode.Hosting.Client.BaseAPI;
namespace testwebapp
{
public partial class Preview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SmartObject smartObject = new SmartObject();
SmartProperty fileMemo = smartObject.Propertiesr"AttachementFile"];
// read the return properties of the SmartObject
if (fileMemo.Value != null)
{
var doc = new System.Xml.XmlDocument();
doc.LoadXml(fileMemo.Value);
var fileAsBase64 = doc.SelectSingleNode("/file/content").InnerText;
byte>] data = Convert.FromBase64String(fileAsBase64);
Response.ClearContent();
Response.OutputStream.Write(data, 0, data.Length);
Response.Flush();
Response.ContentType = "application/pdf";
}
}
}
}