Search code examples
artifactoryjfrog-cli

how to deploy a URL file into artifactory


I have a artifact which is accessible as URL and would like to deploy to artifactory.

As per the site https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API

we can use a local file to deloy with parameter -T as below

deploy the file 'myNewFile.txt', which is located in your Desktop directory, ('~/Desktop/myNewFile.txt')

curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt" -T Desktop/myNewFile.txt

However, am not able to find a mechanism to deploy a URL based file

Any workaround or alternatives please


Solution

  • As far as I'm aware, curl can't directly do what you're describing. Instead, you need to download the file to a temporary location first, and then deploy it from there:

    curl http://<fileurl> -o file.txt
    curl -X PUT "http://localhost:8081/artifactory/repo/dir/file.txt" -T file.txt
    

    You can then delete file.txt.