Unable to download file attachment from item using AGILE 9.3.3 CoreServices.
Hello,
I am using AGILE 9.3.3 Core Services to download attachment from an item.
I could able to retrive the filename, file size from the client code as below.
However, unable to get file downloaded in my system.
Is there anything that I need to do in addition to get file downloaded ?Please explain.
GetFileAttachmentRequestType getFileAttachmentRequestType=new GetFileAttachmentRequestType();
AgileGetFileAttachmentRequest agileGetFileAttachmentRequest[]=new AgileGetFileAttachmentRequest[1];
agileGetFileAttachmentRequest[0]=new AgileGetFileAttachmentRequest();
agileGetFileAttachmentRequest[0].setClassIdentifier(“Part”);
agileGetFileAttachmentRequest[0].setObjectNumber(partNumber);
agileGetFileAttachmentRequest[0].setAllFiles(false);
AgileFileAttachmentRequestType attachments[]=new AgileFileAttachmentRequestType[1];
attachments[0]=new AgileFileAttachmentRequestType();
attachments[0].setRowId(6014963);
agileGetFileAttachmentRequest[0].setAttachments(attachments);
getFileAttachmentRequestType.setRequests(agileGetFileAttachmentRequest);
System.out.println(“attachments:”+attachments.getClass());
GetFileAttachmentResponseType getFileAttachmentResponseType=agileStub.getFileAttachment(getFileAttachmentRequestType);
System.out.println(“Response code:”+getFileAttachmentResponseType.getStatusCode()+”n”+attachments[0].getFiles());
AgileGetFileAttachmentResponse responses[] =getFileAttachmentResponseType.getResponses();
AgileFileAttachmentResponseType attachmentsResp[]=responses[0].getAttachment();
System.out.println(“FileName:”+attachmentsResp[0].getName());
Thanks,
Surya
Have you solved this? If so please explain how so we might have some guidance if this question comes back up.
Hi Patrick,
Yes I solved it by converting “file content” to “byte stream” and displaying that output stream in a JSP Page.
Thanks,
Surya