Hub File Cache REST API

Digital HUB

The Hub provides a REST API for caching client-uploaded files. This gives you the ability to use only cached file descriptors for form processing and avoid using multipart data. Also, this feature improves user experience since the user can upload files separately—and it is faster than a batch upload.

POST /api/files/cache

Uploads a new file to cache. The file is a multipart representation of uploaded file.

Request

Here's an example request:

Response

  • Success response: 201 Created - file was added to cache, file descriptor is returned as a result:
  • Error response: 400 Bad Request - error during file upload

DELETE /api/files/cache/{uuid}

Removes a file containing a uuid from the cache and deletes it from the server.

  • uuid: UUID of the file in the cache

Request

Here's an example request:

Response

  • Success response: 200 OK - the file was removed from the cache
  • Error response: 400 Bad Request - error during file deletion. File was not deleted