# Uploading nar (maven plugin) file error

I’m trying to upload a .nar file to a nexus repository using curl. I get the following error when attempting to do so:

> 400 Detected content type \[application/zip, application/x-zip-compressed\], but expected \[application/vnd.iptc.g2.newsmessage+xml, application/xml\]

I don’t have issues uploading .jar files with the same method so I’m wondering if anyone has any experience with uploading .nar files.

## post by jarrettammerman on Jun 14, 2024

Jarrett Ammerman

## post by mpiggott on Jun 20, 2024

You may need to turn off strict content type validation for the repository. The error message suggests content type detection is choosing the incorrect type.

## post by David_Kugele on Dec 4, 2025

I’m having the same issue and we turned off strict content type validation for the repo but we are still getting the error. We are running version 3.73.

## post by David_Kugele on Feb 9

[@mpiggott](https://community.sonatype.com/u/mpiggott) Is there anything I can try if turning off strict content type validation still doesn’t fix the issue?

## post by mpiggott on Feb 10

I don’t have a nar file, but searching suggests it's simply a zip. So I rename an archive and use the automatically created maven-releases repository which has strict content-type validation disabled:

```bash
curl -v -X PUT -T foo.nar http://localhost:8081/repository/maven-releases/g/a/1/a-1.nar
```

If I turn on _Validate that all content uploaded to this repository is of a MIME type appropriate for the repository format_ in the repository configuration and retry then the result is as you describe:

```bash
< HTTP/1.1 400 Detected content type [application/zip, application/x-zip-compressed], but expected [application/vnd.iptc.g2.newsmessage+xml, application/xml]: /g/a/1/a-1.nar
< Server: Nexus/3.90.0-SNAPSHOT (PRO)
< 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: 0
< Content-Length: 0
```

This works as I would expect (though the detected content type is likely wrong), all I can really suggest is upgrading to a newer version of Nexus.

## post by mpiggott on Feb 10

[@David_Kugele](https://community.sonatype.com/u/david_kugele) if you’re a repo pro customer, I would suggest having one of your support contacts file a ticket with support.
