Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Attachments downloaded via API are only 8 kb

Tyler C. Borg December 4, 2015

I am using a C# application to interact with the Confluence REST API. 

  1. My download file function takes a URL and a local path to save the file, I tested on a 23kb file hosted on anonymous web domain, also on https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png and both work fine.
  2. My API functions pull all attachments from a Confluence page using page id https://mysite.atlassian.net/wiki/rest/api/content/123456789/child/attachment.
  3. If I take the path my app produces and put it in my browser manually it will download the full file https://mysite.atlassian.net/wiki/download/attachments/123456789/filename.zip. I can open the local file and it works fine.
  4. When my app uses that path however the downloaded file is only 7.56kb and it will not open.

In summary it seems like there may be a setting somewhere limiting the download size of attachments for applications but I can't seem to locate any documentation mentioning this. Any help is appreciated.

Thanks and Regards,

Tyler C. Borg

 

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Tyler C. Borg December 4, 2015

I just solved my problem and realized this was my mistake for overlooking permissions in Confluence. This page https://answers.atlassian.com/questions/195899 solved my problem. In summary I added on the username and password as query strings (?os_username=un&os_password=psw) to the file URL and it solved it.

0 votes
Tyler C. Borg December 4, 2015

#3 The reason this works was because my browser was already authenticated, if I open up a different browser I get the login page which is the 7.56kb response I was getting back.

TAGS
AUG Leaders

Atlassian Community Events