Import images through the API

We are trying out importing images through the API, but haven't had any luck. Has anyone already tried this? Is there an import function or any function specific to images?

string myEdt1 = "EDTXML";
string guidid = "GUID-"+Guid.NewGuid().ToString();
string version = "1";
string xmlMetadata = "<ishfields>" +
"<ishfield name='FTITLE' level='logical'>New Image</ishfield>" +
"<ishfield name='DOC-LANGUAGE' level='lng'>en-US</ishfield>" +
"<ishfield name='FSTATUS' level='lng'>Draft</ishfield>" +
"</ishfields>";
string someUrl = "">www.google.com/.../ps_logo2.png";

using (var webClient = new WebClient())
{
byte[] imageBytes = webClient.DownloadData(someUrl);
//Create image
userClientDocumentObj.Create(2521468, "ISHIllustration", ref guidid, ref version, "en-US", "Low",
xmlMetadata, myEdt1, imageBytes);
}

Parents Reply Children
No Data