본문 바로가기
리눅스/Bash

[curl] curl: option --data-binary: out of memory 오류가 발생할 때 해결 방법

by hs_seo 2024. 9. 3.

curl 에서 파일을 업로드 할 때 작은 용량의 데이터는 --data-binary 를 이용할 수 있습니다. 이때 out of memory 오류가 발생하면 -T 옵션을 이용하면 됩니다.

 

-T(--upload-file) 옵션은 파일을 서버에 업로드 할 때 주로 사용합니다.

 

curl -T filename.txt http://example.com/upload

 

 

-d (--data-binary) 옵션은 텍스트 데이터를 그대로 전송할 때 주로 사용합니다.

curl --data-binary @filename.txt http://example.com/upload
반응형