Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When uploading binary content, clients may also provide a size and SHA-1 checksum digest with their request. Fedora will validate the uploaded content against the SHA-1 hash to ensure the data was correctly transfered. In any case, Fedora 4 will calculate and store that information to ensure it has something to run fixity checks against later.

Example

Code Block
$ curl --data-binary "@image.png" "http://localhost:8080/rest/fcr:new/fcr:content?checksum=urn:sha1:5441456941dd8b3ee0832b991ee93ba0c0a558f7 --data-binary @image.png"
-> 201 Created
 
$ curl --data-binary "@image.png" "http://localhost:8080/rest/fcr:new/fcr:content?checksum=urn:sha1:bad-checksum --data-binary @image.png"
-> 409 Conflict
urn:sha1:bad-checksum did not match urn:sha1:5441456941dd8b3ee0832b991ee93ba0c0a558f7

...