How do I upload a new resource file ?
Create a new resource file by sending a POST (create) request on the resource file upload collection: /api/dam/file-resources
A POST request on /api/dam/file-resources/images/home/logo
will store a file logo-XXXXX
in images/home
folder. The content type will define the file extension.
Sample request:
POST /api/dam/file-resources/images/home/logo
Content-Type: image/png
Content-Length: 12314564
<my-logo.png content>
If the upload is successful, the API returns a 201 Created
status code and the location of the resource file in Location
response header.
Sample response:
HTTP/1.1 201 Created
Location: http://baobab.keepeek.com/medias/domain1/images/home/logo-ULsQ7.png
In file resource services, a cache is implemented to optimise calls on filesystem. The file name contains 5 randomly generated characters to bypass the cache when the file is replaced.
For more details about file upload, please refer to resource files relations