Anant Kahar
Anant Kahar

Reputation: 1

How to download files from jFrog repository using curl command

I'm trying to download .EAR file from jFrog artifactory using curl command and save it on to the server.

curl -k -b "/appl/webappl/server/cookie.txt" "https://jfrog.dev.com/ui/v1/download?repoKey=key&path=path%252Ffile.ear" -o "/appl/webappl/server/file.ear"

Questions:

  1. How to select this specific url from dev tools on browser "https://jfrog.dev.com/ui/v1/download"
  2. How to choose repoKey and the path
  3. Why can't we use direct url to the file

Upvotes: 0

Views: 38475

Answers (3)

Brian Kuepper
Brian Kuepper

Reputation: 11

If you need it to prompt you for a password this works:

curl -su 'user' -X GET https://jfrog.dev.com/ui/v1/download?repoKey=key&path=path%252Ffile.ear -o /appl/webappl/server/file.ear

Upvotes: 0

Gajapathi Kimidi
Gajapathi Kimidi

Reputation: 569

I have a repository called maven-local, and uploaded an ear file called test.ear under the path com/test/jfrog.

We can use the below curl command directly to download the file:

curl -u "user:password" -X GET https://myartifactory.jfrog.io/artifactory/maven-local/com/test/jfrog/test-test.ear -H 'Content-Type:application/json' -o test.ear

Upvotes: 4

Saiprakash annam.a
Saiprakash annam.a

Reputation: 53

The below solution was worked for me.

curl -vk -u username:password/apikey -X GET 'https://repo_path/file_path/file_name' > file_name 

Upvotes: 1

Related Questions