Nexus REST API Upload to Raw repository upload empty files

Trying to upload files to a Raw repository in Nexus using the REST API.

Taken from the Maven Examples, but changed to use Raw fields.

curl -v -u 'deployment:password' -X POST -F '' -F 'raw.asset1=fileArchive.tar.gz' -F 'raw.asset1.filename=fileArchive.tar.gz' ''

Not sure what is wrong. The files are uploaded, but they are empty in Nexus.
Running Nexus OSS 3.21.1

While writing this I took a look at suggested existing topics.
There I found another way to upload to RAW.

This works.
curl -v -u 'deployment:password' --upload-file fileArchive.tar.gz ''

Perhaps this could have been told in the documentation for the REST API, with RAW Examples.

1 Like