# \[웹한글v1,v2\] InsertFile 액션 지원 포맷 문의

**URL:** https://forum.developer.hancom.com/t/v1-v2-insertfile/2657
**Category:** 웹한글 기안기
**Created:** [7월 21, 2025, 12:17오전 UTC](https://forum.developer.hancom.com/t/v1-v2-insertfile/2657 "2025-07-21T00:17:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![user343](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/user343/32/1331_2.png) [@user343](https://forum.developer.hancom.com/u/user343)
#### Post date: [7월 21, 2025, 12:17오전 UTC](https://forum.developer.hancom.com/t/v1-v2-insertfile/2657/1 "2025-07-21T00:17:03Z")

</div>

안녕하세요.  
페이지 레이아웃을 유지하고자 InsertFile 액션을 사용하여  
JSON 포맷의 문서를 삽입하려고 시도하였으나,  
`hwpAction.Execute`의 반환값이 `false`로 확인되어 문의드립니다.

```javascript
const hwpAction = HwpCtrl.CreateAction('InsertFile');

if (hwpAction == null) {
  throw new Error('InsertFile 액션을 생성하지 못하였습니다.');
}

const hwpSet = hwpAction.CreateSet();
hwpAction.GetDefault(hwpSet);
hwpSet.SetItem('FileName', 'HWPJSON 포맷 파일을 다운로드 받을 수 있는 서버 URL');
hwpSet.SetItem('FileFormat', 'JSON');
hwpSet.SetItem('FileArg', '');
hwpSet.SetItem('KeepSection', 1);
hwpSet.SetItem('KeepStyle', 1);
hwpSet.SetItem('KeepCharshape', 1);
hwpSet.SetItem('KeepParashape', 1);

// 이 시점에 result가 false임.
const result = hwpAction.Execute(
      hwpSet,
      (action, paramSet, _result, callbackUserData) => {
        console.info(_result ? '성공' : '실패');
      },
     {}
);

if (result) {
  throw new Error('실패');
}

```

혹시 InsertFile 액션에서는 JSON 포맷을 지원하지 않는 것인지요?  
지원하는 포맷 종류를 안내해주시면 감사하겠습니다.

감사합니다.

---

<div class="post-metadata">

### Author: ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://forum.developer.hancom.com/u/bart)
#### Post date: [8월 4, 2025, 3:40오전 UTC](https://forum.developer.hancom.com/t/v1-v2-insertfile/2657/2 "2025-08-04T03:40:48Z")

</div>

안녕하세요.

JSON 형식은 url 형식으로는 지원하지 않습니다.

다운받은 json 문자열 형식으로 API 요청하시면 동작 가능합니다.

감사합니다.

---

<div class="post-metadata">

### Author: ![user343](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/user343/32/1331_2.png) [@user343](https://forum.developer.hancom.com/u/user343)
#### Post date: [8월 7, 2025, 5:52오전 UTC](https://forum.developer.hancom.com/t/v1-v2-insertfile/2657/3 "2025-08-07T05:52:48Z")

</div>

안내해 주신 방식으로 잘 동작합니다! 감사합니다!
