Any help would be appreciated.
public void UploadFile(Stream stream, string fileName, int databaseId, ref MFilesRepository mFilesRepo, string customerNumber)
{
List<PropertyValue> properties = new List<PropertyValue>();
properties.Add(new PropertyValue() { PropertyDef = 100, TypedValue = new TypedValue() { DataType = MFDataType.Lookup, Lookup = new Lookup() { Item = 293, Version = -1 } } }); // Class
properties.Add(new PropertyValue() { PropertyDef = 0, TypedValue = new TypedValue() { Value = fileName, DataType = MFDataType.Text } }); // I'm a document
properties.Add(new PropertyValue() { PropertyDef = 1561, TypedValue = new TypedValue() { Value = databaseId, DataType = MFDataType.Integer } }); // Associated database id
if (!String.IsNullOrEmpty(customerNumber))
{
List<Lookup> lookups = new List<Lookup>();
lookups.Add(new Lookup() { Version = -1, Item = int.Parse(customerNumber) });
properties.Add(new PropertyValue() { PropertyDef = 1229, TypedValue = new TypedValue() { DataType = MFDataType.MultiSelectLookup, Lookups = lookups.ToArray() } });
}
mFilesRepo.CreateObject(0, properties.ToArray(), stream, fileName);
}