简体   繁体   中英

How do I download a file from LiveLink using c#?

I am writing ac# agent to pull data out of Excel workbooks stored in Livelink but I am unable to download the files.

webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials;
webClient.DownloadFile(strFileLocation, TEMP_FILE_LOC);

This is the code I am using to save the file. strFileLocation is a link generated using the make link utility in Livelink and it is a http link

Here is the code

( http://LivelinkServer.com/Livelink/livelink.exe?func=ll.GetTZ&NextURL=%2FLivelink%2Flivelink%2Eexe%3Ffunc%3Dll%26objId%3D128027626%26objAction%3Ddownload%26viewType%3D1 )

I get an excel document that has a progress bar that says "Please wait a moment while Livelink is loading..." this looks, to me, like the page that redirects the request in order to get the actual file.

I appears to use a double hop in order to direct you to the file on the Livelink server via the URL it gives you, but I do not know what webservice it calls, examining the response headers gives no clues.

Does anyone know how to correctly access a file on a Livelink sever?

Any help would be greatly appreciated, thank you.

You have to call the Web Service function (SOAP)

GetVersionContents(ID, versionNum)

to get the actual data from which you can create a local file.

谢谢您的回答,但在与我公司的Livelink部门联系后,我发现我需要在单独的端口上访问此服务以允许正确的身份验证类型

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM