DevOps Wiki: How to enable download of attachment

Copper Contributor



I do have a git based wiki in ADO with the following structure:

| ----
| ---- .attachments
       | ---- config.xml

Within I want to reference config.xml in a way that:

1. enforces the file to be downloaded and not opened

2. ensures a meaningful file name proposal for the download


For "common" markdown this would be something like:



unfortunately ADO performs some URL-encoding to this relative link and tries to find a file named:
- ./attachments/config.xml%3Fdownload%3Dtrue%26name%3Dconfig.xml

This file cannot be found (why should it, such a file does not exist)


My questions are:

1. How to properly format the relative link in ADO markdown to make the attachment downloadable

2. How to properly format the relative link in ADO markdown to define the attachments name



- The answer "Use an absolute link like https://..../" is not an option as no-one will ever be able to maintain this across multiple branches


Thank you in advance ;)

2 Replies


ADO markdown to make an attachment downloadable





To define the attachment





Thanks for your reply, but as mentioned in my initial post this is what i already tried. ADO is messing up the url when using your approach resulting in the folloing error:

  "message":"TF401174: The item 'wiki/.attachments/config.xml?download=true&fileName=config.xml' could not be found in the repository '<nonOfYourBusiness>' at the version specified by '<Branch: feature/2191 >' (resolved to commit '1dfc...bfd4')",
  "typeName":"Microsoft.TeamFoundation.Git.Server.GitItemNotFoundException, Microsoft.TeamFoundation.Git.Server",


The reason for that - as mentioned above - is that the resulting url contains no real url parameters but encodes any char "?" or "&" as utf escaped char: