Can't use curl to download artifacts

RonG's Avatar

RonG

01 May, 2018 10:29 PM

I'm trying to use curl (from a Mac) to download artifacts, but I just get back zero bytes. No error, just zero bytes.

I'm doing the following:

curl -H "Authorization: Bearer xxxxxxxxxxxxx" https://ci.appveyor.com/api/projects/xxxxx/xxxxxxx/artifacts/xxxxxxx.zip

If I enter the url into a browser (Chrome), then the file comes down correctly.

If I spell the artifact wrong or don't have the Authorization: Bearer, then I (correctly) get an error back.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 01 May, 2018 11:22 PM

    Ilya Finkelshteyn's Avatar

    Artifacts stored in Azure blob storage. This request is being redirected to temporary URL on Azure. For some reason curl is sending authorization header to URL it was redirected to. It should not be sent.

    Simpler option is use PowerShell:
    https://www.appveyor.com/docs/api/samples/download-artifacts-ps/
    https://www.appveyor.com/docs/api/samples/download-artifacts-advanc...

    I know some our clients did custom solution with getting second URL and sending new request to it, check this sample: https://github.com/parekhkb/DownloadLatestAppVeyorBuild/blob/master...

    Ilya.

  2. 2 Posted by RonG on 01 May, 2018 11:26 PM

    RonG's Avatar

    This all needs to be done from a non-windows machine, so using PowerShell is not an option. I'll look at the second URL code, it might do what I need.

    Thanks.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 01 May, 2018 11:27 PM

    Ilya Finkelshteyn's Avatar

    PowerShell Core is perfect option, but it is up to you.

  4. 4 Posted by Volker Enderlei... on 03 May, 2018 09:40 PM

    Volker Enderlein's Avatar

    I was facing similar problems. See if the solution mentioned in thread helps you further.

    Cheers Volker

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac