I have requirement where i need to retrieve the images from the document and to place it in a sharepath location in a bytestream format. I have access to the document id and i have established the connection to the filenet content engine. Is there anyone who knows the api codes to retrieve the image from the document.If incase there are multiple images how can i iterate those images.
Asked
Active
Viewed 199 times
1 Answers
0
Look at this example from IBM:
public static void WriteContentToFile(IDocument doc, String path)
{
String fileName = doc.Name;
String file = Path.Combine(path, fileName);
try
{
FileStream fs = new FileStream(file, FileMode.CreateNew);
BinaryWriter bw = new BinaryWriter(fs);
Stream s = doc.AccessContentStream(0);
byte[] data = new byte[s.Length];
s.Read(data,0,data.Length);
s.Close();
bw.Write(data);
bw.Close();
fs.Close();
}
catch (Exception e)
{
System.Console.WriteLine(e.StackTrace);
}
}

hce
- 1,107
- 9
- 25