주 콘텐츠로 건너뛰기

카카오클라우드 도움말

[Object Storage] API를 사용하여 캐시 관련 헤더를 추가한 파일 업로드 방법이 궁금해요.

아래 두 가지 방법으로 메타데이터를 설정하실 수 있습니다.

방법 1. 시스템 메타데이터 추가 시, 헤더로 바로 추가하는 방법
curl -X PUT ""https://{OBJECT_STORAGE_HOST}/v1/{projectId}/{bucket}/{uploadPath}/{fileName}"" \
 --header ""X-Auth-Token: $API_TOKEN"" \
 --header 'Content-Type: application/octet-stream' \
 --header 'cache-control: no-cache, no-store, must-revalidate' \
 --data-binary @/path/to/file

방법 2. 사용자 메타데이터 추가 시, X-Object-Meta-{metadata-name} 헤더 추가 방법
curl -X PUT ""https://{OBJECT_STORAGE_HOST}/v1/{projectId}/{bucket}/{uploadPath}/{fileName}"" \
 --header ""X-Auth-Token: $API_TOKEN"" \
 --header 'Content-Type: application/octet-stream' \
 --header 'X-Object-Meta-cache-control: no-cache, no-store, must-revalidate' \
 --data-binary @/path/to/file

자세한 내용은 관련문서를 참고해 주세요.

이 내용이 도움이 되었나요?
0명 중 0명이 도움이 되었다고 했습니다.
소중한 의견 주셔서 감사합니다