# Curl upload request issue

**URL:** <https://community.sonatype.com/t/curl-upload-request-issue/7725>\
**Category:** Sonatype Nexus Repository\
**Tags:** upload\
**Created:** [November 25, 2021, 2:13pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725 "2021-11-25T14:13:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoroglucihat](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zoroglucihat](https://community.sonatype.com/u/zoroglucihat)\
**Post date:** [November 25, 2021, 2:13pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/1 "2021-11-25T14:13:11Z")

</div>

[root@localhost pamuser]# curl -v -u admin:admin --upload-file ${FILENAME} ${DESTINATION}

- About to connect() to 1.1.1.1 port 8081 (#0)
- Trying 1.1.1.1…
- Connected to 1.1.1.1 (1.1.1.1) port 8081 (#0)
- Server auth using Basic with user ‘admin’

> PUT /repository/3.0.0-core/389-ds-base-devel-1.3.10.2-12.el7\_9.x86\_64.rpm HTTP/1.1  
> Authorization: Basic YWRtaW46a3IxMGlwc2xh  
> User-Agent: curl/7.29.0  
> Host: 10.20.42.52:8081  
> Accept: _/_  
> Content-Length: 1925  
> Expect: 100-continue

\< HTTP/1.1 100 Continue

- We are completely uploaded and fine  
\< HTTP/1.1 400 Invalid RPM: 389-ds-base-devel-1.3.10.2-12.el7\_9.x86\_64.rpm  
\< Server: Nexus/3.36.0-01 (OSS)  
\< X-Content-Type-Options: nosniff  
\< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation  
\< X-XSS-Protection: 1; mode=block  
\< Content-Length: 0  
\<
- Connection #0 to host 1.1.1.1 left intact

---

<div class="post-metadata">

**Author:** ![zoroglucihat](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zoroglucihat](https://community.sonatype.com/u/zoroglucihat)\
**Post date:** [November 25, 2021, 2:13pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/2 "2021-11-25T14:13:46Z")

</div>

I tried curl upload for my rpms but it is given this error.

---

<div class="post-metadata">

**Author:** ![mprescott](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/mprescott/32/178_2.png) [@mprescott](https://community.sonatype.com/u/mprescott)\
**Post date:** [November 26, 2021, 10:49pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/3 "2021-11-26T22:49:53Z")

</div>

Have you looked in the Nexus Repository logs to see if there’s any more information? Do you expect your RPM to be only 1925 bytes?

---

<div class="post-metadata">

**Author:** ![zoroglucihat](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zoroglucihat](https://community.sonatype.com/u/zoroglucihat)\
**Post date:** [November 29, 2021, 11:31am UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/4 "2021-11-29T11:31:50Z")

</div>

it has given 405 error.

---

<div class="post-metadata">

**Author:** ![zoroglucihat](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zoroglucihat](https://community.sonatype.com/u/zoroglucihat)\
**Post date:** [November 29, 2021, 11:32am UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/5 "2021-11-29T11:32:41Z")

</div>

admin [29/Nov/2021:14:32:17 +0300] “POST /service/extdirect/poll/rapture\_State\_get HTTP/1.1” 200 1394 77 5 “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36” [qtp864348718-437]

---

<div class="post-metadata">

**Author:** ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)\
**Post date:** [November 29, 2021, 12:17pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/6 "2021-11-29T12:17:39Z")

</div>

Error code 405 means that the HTTP method is not allowed at the resource you’re requesting.  
The log line you posted shows that you are trying to use an internal API that is not meant to be used by users.  
Please have a look at this [article that shows how to upload a file to Nexus Repository 3](https://support.sonatype.com/hc/en-us/articles/115006744008-How-can-I-programmatically-upload-files-into-Nexus-3-).

---

<div class="post-metadata">

**Author:** ![akulbe](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@akulbe](https://community.sonatype.com/u/akulbe)\
**Post date:** [November 29, 2021, 4:57pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/7 "2021-11-29T16:57:11Z")

</div>

@dsawa Is it possible to use the API for uploading directories with files/directories in them?

---

<div class="post-metadata">

**Author:** ![zoroglucihat](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zoroglucihat](https://community.sonatype.com/u/zoroglucihat)\
**Post date:** [November 29, 2021, 5:40pm UTC](https://community.sonatype.com/t/curl-upload-request-issue/7725/8 "2021-11-29T17:40:43Z")

</div>

I finally did it, upload and download via curl multiple file folder etc.

> **[GitHub - zoroglucihat/Nexusdownload](https://github.com/zoroglucihat/Nexusdownload)**
>
> Contribute to zoroglucihat/Nexusdownload development by creating an account on GitHub.
