Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Connections file download doesn't work? #1750

Open
jrobichaux opened this issue Jan 8, 2016 · 0 comments
Open

Connections file download doesn't work? #1750

jrobichaux opened this issue Jan 8, 2016 · 0 comments

Comments

@jrobichaux
Copy link

I'm trying to download a file from Connections using this code:

FileService service = new FileService();
EntityList<File> myFiles = service.getMyFiles();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
service.downloadFile(stream, myFiles.get(0).getFileId());

The Connections server returns:

<?xml version="1.0" encoding="UTF-8"?><td:error xmlns:td="urn:ibm.com/td"><td:errorCode>UnsupportedOperation</td:errorCode></td:error>

I get the same result on my company Connections server and on Greenhouse (long may it live).

The URL being sent to the Connections server is of this format:

files/basic/api/myuserlibrary/file/{FILEID}//media

Looking at the Connections API documentation (from at least version 3 on up), it appears that the /file/ part of the URL just before the FileID is actually supposed to be /document/
https://www-10.lotus.com/ldd/lcwiki.nsf/dx/Downloading_a_file_ic55

Also, the Connections server doesn't seem to like the double-forward slash after the file ID (//media). This URL works fine:

files/basic/api/myuserlibrary/document/{FILEID}/media

It looks like this would be a simple change in com.ibm.sbt.services.client.connections.files.FileUrls, but I was hoping that someone could check me on this (and officially change it). Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant