GitHub-style download buttons - tarball and zip

Issue #7 wontfix
Chris Fordham created an issue

Per https://answers.atlassian.com/questions/316909/how-to-enable-download-as-tar-gz-with-addon-com-atlassian-stash-plugin-stash-archive it would be good to not have a Download button with default of downloading zip.

Option to configure the button within the plugin and if possible provide a method to click download for tarball or zip. The use case for me at the time was a script that takes a remote source tarball (a zip file is the wrong format). For desktop user, the GUI element is handy.

Comments (5)

  1. Justin Collum

    Agreed. This should be easy to implement. NPM does not support direct installation of ZIP files but does for TAR.

  2. Bryan Turner Account Deactivated

    @chris_fordham_iit @jcollum_cdk,

    Could either of you clarify why the "Download" button would need to allow downloading a tarball? For a script, or for NPM, wouldn't you just give it a URL that returned a tarball? That's already possible with the add-on as implemented; you'd just add &format=tar.gz to your URL, as indicated on the Answers question. Or is the goal for you to be able to get the tgz link from the button and then use it in your script without having to modify it? Or maybe it's just convenience?

    Best regards, Bryan Turner Atlassian Bitbucket

  3. Chris Fordham

    The issue is like you explained - its actually a usability problem, not convenience. Make it intuitive for the user so they know the answer without having to go to google and find it. You could provide two links/buttons for the download - zip and tarball. GitHub have changed their UI a few times now and only have typically a ZIP button now however, everyone knows to just change the extension to .tar.gz to get the tarball. Knowing to append a variable to the query string is a bit more obscure.

  4. Bryan Turner Account Deactivated

    I'd rather keep the UI concise here. Adding two buttons seems like overkill. To try and simplify getting a tarball, I've modified the URL so that it includes format=zip from go. As with GitHub, then, you can get a tarball simply by modifying the format that's already in the URL; no more need to add a new query parameter yourself. If "everyone knows to change the extension" in GitHub, it should be equally simple to update this URL.

  5. Log in to comment