# How to transfer artifact (file) to artifactory using URI

**URL:** <https://forum.ansible.com/t/how-to-transfer-artifact-file-to-artifactory-using-uri/35486>\
**Category:** Ansible Project\
**Created:** [July 9, 2021, 8:13pm UTC](https://forum.ansible.com/t/how-to-transfer-artifact-file-to-artifactory-using-uri/35486 "2021-07-09T20:13:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mateusz\_Panczyszyn](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Mateusz\_Panczyszyn](https://forum.ansible.com/u/Mateusz_Panczyszyn)\
**Post date:** [July 9, 2021, 8:13pm UTC](https://forum.ansible.com/t/how-to-transfer-artifact-file-to-artifactory-using-uri/35486/1 "2021-07-09T20:13:24Z")

</div>

Hi,

I try to make small improvement in my CI. Normally is done by REST API and curl, for example ([https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API](https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API))

curl -u myUser:ABcdEF -X PUT “[http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt](http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt)” -T Desktop/myNewFile.txt

I did translation from CURL but I cannot transfer file like above

- name: My test  
uri:  
url: [https://myartifactory.net/artifactory/arc-generic-local/CI/mateusz\_test/newfile](https://myartifactory.net/artifactory/arc-generic-local/CI/mateusz_test/newfile)  
method: PUT  
url\_username: myuser  
url\_password: mypass  
follow\_redirects: all  
validate\_certs: no  
status\_code: 201

I tried with src flag and using body and form-multipart but without result. Could you help me with that?

Br,  
Mateusz

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [July 9, 2021, 8:17pm UTC](https://forum.ansible.com/t/how-to-transfer-artifact-file-to-artifactory-using-uri/35486/2 "2021-07-09T20:17:42Z")

</div>

Check out this comment, that describes how I was able to get this working:

[https://github.com/ansible/ansible/pull/33689#issuecomment-376931243](https://github.com/ansible/ansible/pull/33689#issuecomment-376931243)

---

<div class="post-metadata">

**Author:** ![Mateusz\_Panczyszyn](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Mateusz\_Panczyszyn](https://forum.ansible.com/u/Mateusz_Panczyszyn)\
**Post date:** [July 9, 2021, 8:39pm UTC](https://forum.ansible.com/t/how-to-transfer-artifact-file-to-artifactory-using-uri/35486/3 "2021-07-09T20:39:36Z")

</div>

Thanks a lot Matt 🙂 it’s working also in my env. I could ask many hours ago but the most important is that is working fine. You save my time, because I got wrong idea to take output from “shell: curl […]” and do logic for errors handling. Again: thanks and best wishes from Poland.
