Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- sort()
- new Date()
- slice()
- useState()
- React
- filter()
- 교집합
- useRef()
- 소수점 올림내림
- substring()
- useEffect()
- includes()
- getday()
- 3진수
- charAt()
- Eventlitener
- jsx반복문
- 차집합
- 항해99솔직후기 #항해99장점 #항해99단점 #부트캠프추천
- Math.sqrt()
- toUpperCase()
- map()
- Math.floor()
- Number()
- setDate
- indexOf()
- parseInt()
- repeat()
- reat if문
- isNaN()
Archives
- Today
- Total
개발자로 전향중
Buffer image 데이터 base64으로 만들기 본문
fetch('/api/get-image')
.then((data) => data.json())
.then((res) => {
const base64EncodedText = Buffer.from(res.data, 'utf8').toString(
'base64'
)
setUrl(base64EncodedText)
})
const base64 = 'data:image/jpeg;base64,'
var image = base64 + url
//src={image}를 통해 불러오기 가능!
'React' 카테고리의 다른 글
Cloudflare 200MB이상 다이렉트 업로드 (0) | 2023.10.17 |
---|---|
CloudFlare Stream Cloud에 다이렉트 업로드 (0) | 2023.10.17 |
TypeScript 환경변수 설정하고 싶을때 (0) | 2022.12.02 |
Redux-Toolkit TypeScript 여러개의 객체를 배열 추가할때 (0) | 2022.11.24 |
React 체크박스 여러개 체크할 때 체크 value (0) | 2022.11.02 |