here's a piece of sample code that's been shared with me...
Code:
import com.remedy.arsys.api.*;
public class getAttach
{
public static void main(String args[])
{
// Username to login to ARServer
String uname = "Demo";
// Password for the User
String pword = "<your_password>";
// Language
String lang = "";
// ARServer
String serv = "<your_arserver>";
// Create ARServerUser object with supporting information.
ARServerUser context = new ARServerUser(uname, pword, lang, serv);
// Create NameID object adding the form name you wish to retrieve the attachment from in the constructor.
NameID schemaID = new NameID("RESOURCE_Downloads");
// Create EntryID object adding the EntryID of the record you wish to retrieve the attachment from in the constructor
EntryID entryID = new EntryID("000000000000007");
// Create FieldID object adding the fieldID of the attachment field in the constructor
long fid = 536880912;
FieldID fieldID = new FieldID(fid);
// Need to have the Util.ARGetEntryBlob() method in a try block to catch ARException
try
{
// Set a string variable for the name of the attachment
String aname = "ConvertQual.def";
// Set a string variable for the full path of where you wish to copy the attachment to.
String filePath = "C:\\ConvertQual.def";
// Create AttachmentInfo object with supporting information
AttachmentInfo attach = new AttachmentInfo(aname, 0, 0, "");
// Call the setValue() method of the AttachmentInfo object passing in the "full path" string variable.
attach.setValue(filePath);
// Call ARGetEntryBlob with supporting information
Util.ARGetEntryBlob(context, schemaID, entryID, fieldID, attach);
}
catch (ARException e)
{
System.out.println("Exception: " + e.toString());
}
}
}
Hope that helps!