I\'m using the code below to upload a file through Artifactory\'s REST API. My problem is that when I view the file through the GUI I get this message:
I am hitting the same issue using the artifactory-client-java library :-(
So after some digging, it appears that you need to:
For your C# example, the correct solution is to add a header "X-Checksum-Sha1" with the calculated checksum. As explained in the link documentation, a simple curl example is
curl -uadmin:password -T file.jar -H "X-Checksum-Sha1:c9a355147857198da3bdb3f24c4e90bd98a61e8b""http://localhost:8081/artifactory/libs-release-local/file.jar" -i
For artifactory-client-java users, the easy fix is to add to the documented upload example:
java.io.File file = new java.io.File("fileToUpload.txt");
File result = artifactory.repository("RepoName").upload("path/to/newName.txt", file).doUpload();
an additional intermediary call: bySha1Checksum():
java.io.File file = new java.io.File("fileToUpload.txt");
File result = artifactory.repository("RepoName").upload("path/to/newName.txt", file).bySha1Checksum().doUpload();