With the latest release of Gateway Web Services, version 2009.02, you can now attach documents to Profiles. The documentation covers all of the methods that are available for adding, deleting, updated, and downloading Profile documents. There is no limit to the number of documents that a Profile can have. Each document can be up to 4MB and can be any of the following types: .bmp, .doc, .docx, .efx, .gif, .jpeg, .jpg, .pdf, .png, .rtf, .txt, .tif, .xls, .xlsx, .zip.
The code shown below is an example written in C# of how to download a document and display it on a web page.
Example:
CS_DocumentWS.Document wsDocument = new CS_DocumentWS.Document();
CS_DocumentWS.DownloadFile oDownloadFile = new CS_DocumentWS.DownloadFile();
oDownloadFile = wsDocument.DownloadProfileDocument(sUserName, sPassword, iBOID, sCustID, iFileID);
if (oDownloadFile.sErrorCode == "0")
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + oDownloadFile.sFilename);
Response.ContentType = oDownloadFile.sContentType;
Response.BinaryWrite(oDownloadFile.baFileBytes);
Response.End();
}
else
{
// Display Error Messagew
lblError.Text = "Error downloading document: " + oDownloadFile.sErrorMsg;
}