I have some server side code that is programmatically adding some files to the Images & Documents module. The code runs fine and the images are created, but when I go to the module to edit an individual document that I have uploaded using this code, the description field is blank. The text in this field shows up in an overview of an item (not editing it), but when you click edit, the description field is blank. I also have several custom controls that access that field and they display the text from this field without any issues.
This would raise an issue if an end user came in and edited one of these items, as they would save the content item and overwrite the existing metadata with the blank field in the edit form!
The code which programmatically adds the files:
// always set to "Libraries"
// name of library to store to
// path to file to upload
// mime type of file
// Name of document
// (haven't really tested this field)
// <-- problem field!
// (haven't tested this one either)
// These are storing properly
LibraryManager libraryManager =
ILibrary library = libraryManager.GetLibrary(LibraryName);
ContentManager contentManager =
IContent upload =
(var src = File.OpenRead(filename))
upload = libraryManager.UploadFile(src, Path.GetFileNameWithoutExtension(filename), Path.GetExtension(filename), ContentType, library);
IContent image = contentManager.GetContent(upload.ID);
// Problem field
(Tags.Count > 0)
// Store tags