<p>Adding on @sysadmin1138's answer, to push the content of a folder to another folder while keeping the directory structure starting from the source folder, you can use:</p>
<pre><code>(cd source-folder &amp;&amp; jfrog rt upload --detailed-summary --flat=false --recursive ./ artifact-repo/target-folder/
</code></pre>
<p>The <code>--detailed-summary</code> will tell you the details of all the files uploaded.</p>

CC BY-SA 4.0
2021-03-23T20:38:04.973Z
2021-03-23T20:38:04.973Z
felipecrs
<p>Since the original question is also tagged with Nexus this is how to do bulk upload with Nexus 3:</p>

<pre><code>find &lt;directory name&gt;/ \! -type d -print0 | xargs -P10 -0 -I@ curl -v --user &lt;user&gt;:&lt;password&gt; --upload-file ./@ http://localhost:8081/repository/&lt;repository name&gt;/@
</code></pre>

CC BY-SA 4.0
2019-11-05T10:01:24.380Z
2019-11-05T10:01:24.380Z
Markus
<p>This can be done <a href="https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory" rel="nofollow noreferrer">through the Jrog CLI</a>. The CLI has a recursive option that looks like it will do what you hope.</p>
<pre><code>jfrog rt upload --recursive artifactory-mirror/* artifact-repo/dir-struct/
</code></pre>
<p>The CLI also has some performance improvements for uploads that doing it through curl or a browser don't seem to get. Also, scriptable!</p>
<p>To include full directory structure you will want to use the flag --flat=false</p>
<pre><code>jfrog rt upload --flat=false --recursive artifactory-mirror/* artifact-repo
</code></pre>

CC BY-SA 4.0
2018-07-27T06:53:12.573Z
Can we execute the JFrog CLI command on jenkins?
user_9090
CC BY-SA 4.0
2018-07-27T13:23:49.960Z
@Gaurav Definitely, there are command-line flags for the API key and server URLs. We'll be doing it before too long.
sysadmin1138
CC BY-SA 4.0
2020-12-10T15:18:16.490Z
"flat:false" should be "flat=false".
Étienne
CC BY-SA 4.0
2021-03-30T18:42:15.713Z
wildcard asterisk * should either be omitted, or else the string placed in "quotes".
Sam
CC BY-SA 4.0
2018-07-26T14:09:08.313Z
2020-12-10T17:11:37.440Z
2020-12-10T17:11:37.440Z
sysadmin1138
<p>I am new to Artifactory, and I wonder how to upload a directory structure containing many different binaries -- keeping the structure intact -- to an artifactory? </p>

CC BY-SA 4.0
2018-07-26T05:37:58.487Z
Archives like zip and tar are made exactly for this, a single artifact with multiple files within, with their rights and mode.
Tensibai
CC BY-SA 4.0
2018-07-26T09:58:49.150Z
yes, we can use zip or tar for upload, can you please help me if we can get the same structure in the artifactory after the upload (something like unzipping the uploaded zip or tar)
user_9090
CC BY-SA 4.0
2018-07-26T11:44:25.963Z
Well, yes, that's what they are for, `tar` was primarily a backup system (tar means tape archive), so it will unpack the same structure as was packed.
Tensibai
CC BY-SA 4.0
2018-07-26T11:49:23.343Z
yes, but if we want it to extract on the Artifactory only, can this be possible?
user_9090
CC BY-SA 4.0
2018-07-26T11:55:21.753Z
No, multiples files are not an artifact by definition, if all files are independent, then they are multiple artifacts by themselves
Tensibai
<maven><artifactory><nexus>
Directory structure - how do I upload it as-is to an artifactory?
user_9090
# Directory structure - how do I upload it as-is to an artifactory?

(Asked by: username_0 on 2018-07-26)

I am new to Artifactory, and I wonder how to upload a directory structure containing many different binaries -- keeping the structure intact -- to an artifactory?

**Tags:** maven, artifactory, nexus

> **Comments:**
> **username_1**: Archives like zip and tar are made exactly for this, a single artifact with multiple files within, with their rights and mode.  
> **username_0**: yes, we can use zip or tar for upload, can you please help me if we can get the same structure in the artifactory after the upload (something like unzipping the uploaded zip or tar)  
> **username_1**: Well, yes, that's what they are for, `tar` was primarily a backup system (tar means tape archive), so it will unpack the same structure as was packed.  
> **username_0**: yes, but if we want it to extract on the Artifactory only, can this be possible?  
> **username_1**: No, multiples files are not an artifact by definition, if all files are independent, then they are multiple artifacts by themselves  

---

## 3 answers

### Answer by username_4 on 2018-07-26. Score: 6 | Accepted answer

This can be done through the Jrog CLI. The CLI has a recursive option that looks like it will do what you hope.
jfrog rt upload --recursive artifactory-mirror/* artifact-repo/dir-struct/

The CLI also has some performance improvements for uploads that doing it through curl or a browser don't seem to get. Also, scriptable!
To include full directory structure you will want to use the flag --flat=false
jfrog rt upload --flat=false --recursive artifactory-mirror/* artifact-repo

> **Comments:**
> **username_0**: Can we execute the JFrog CLI command on jenkins?  
> **username_4**: @Gaurav Definitely, there are command-line flags for the API key and server URLs. We'll be doing it before too long.  
> **username_5**: "flat:false" should be "flat=false".  
> **username_6**: wildcard asterisk * should either be omitted, or else the string placed in "quotes".  

---

### Answer by username_2 on 2021-03-23. Score: 1

Adding on @username_4's answer, to push the content of a folder to another folder while keeping the directory structure starting from the source folder, you can use:
(cd source-folder && jfrog rt upload --detailed-summary --flat=false --recursive ./ artifact-repo/target-folder/

The --detailed-summary will tell you the details of all the files uploaded.


---

### Answer by username_3 on 2019-11-05. Score: 1

Since the original question is also tagged with Nexus this is how to do bulk upload with Nexus 3:
find / \! -type d -print0 | xargs -P10 -0 -I@ curl -v --user : --upload-file ./@ http://localhost:8081/repository//@


---

