Service Desk Practitioners Forum
cancel

How can I get links to attachments on ftp by WebApi

Highlighted
Siekierko Przem
Respected Contributor.

How can I get links to attachments on ftp by WebApi

Hi !!

I need to find ftp links to servicecall attachments. I was trying to do this like that:

IAttachment attachment = servicecall.getAttachment();
IAttachedItem attachedItems[] = attachment.getAttachedItems();

for(int i=0; i System.out.println(attachedItems[i].getFilename());
}

But the results are paths to places from files where attached:
C:\Documents and Settings\Administrator\Moje dokumenty\HPOV start.rtf
C:\Documents and Settings\Administrator\Pulpit\Nowy Dokument tekstowy.txt
C:\Documents and Settings\Administrator\Pulpit\Kopia Nowy Dokument tekstowy.txt


But I found this files on ftp (manually) and SD gets those file from hire:

ftp://172.21.13.11/sd/Servicecall/000/000/000/000/000/000/010/005/1bc/c1f/67/00000000-0000-0000-0001-00051bd5030f
ftp://172.21.13.11/sd/Servicecall/000/000/000/000/000/000/010/005/1bc/c1f/67/00000000-0000-0000-0001-00051c0d01ec
ftp://172.21.13.11/sd/Servicecall/000/000/000/000/000/000/010/005/1bc/c1f/67/00000000-0000-0000-0001-00051c0d01ed

How can I get links to this attachments on ftp by WebApi ??
Or maybe someone can explain structure of folders created on ftp by SD ??

Thanks for help.
4 REPLIES
George M. Meneg
Acclaimed Contributor.

Re: How can I get links to attachments on ftp by WebApi

George M. Meneg
Acclaimed Contributor.

Re: How can I get links to attachments on ftp by WebApi

Have a look at the attached java file (taken form the DOC subdirectory of SP19)
menes fhtagn
Siekierko Przem
Respected Contributor.

Re: How can I get links to attachments on ftp by WebApi

I was trying to run this example from SD SP19 but I'm using SD with SP17 and when I'm trying to open Attachment server then applicaton thow exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/ftpclient/FtpException
at com.hp.ifc.attachments.ftp.FTP.openAttachmentServer(Unknown Source)
at com.hp.ifc.attachments.AttachmentServer.openAttachmentServer(Unknown Source)

This is the way how im starting this method:

final AttachmentServer attachmentServer = AttachmentServer.openAttachmentServer(
server_type, new String[]{attachmentServerName,
attachmentServerTargetFolder, attachmentServerUserName,
attachmentServerPassword,
usePassiveFTP});


I don't understand this exception, maybe someone can explain it for me ?? And if someone know solution how to open attachment server I would be very thankful.
Siekierko Przem
Respected Contributor.

Re: How can I get links to attachments on ftp by WebApi

After I added this library:

"c:\Program Files\Hewlett-Packard\OpenView\service desk 4.5\client\lib\libftp.jar"

to my project, everything started going correctly.