# GetFileBinaryItem

### int GetFileBinaryItem(int lMsgId, string strFile)

수신한 메시지의 Binary Item을 지정한 경로의 파일명으로 저장함.

{% hint style="warning" %}
저장할 경로가 올바르지 않으면 생성되지 않습니다.
{% endhint %}

Parameters

<table data-header-hidden><thead><tr><th width="169" valign="top"></th><th width="93" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Name</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">lMsgId</td><td valign="top">int</td><td valign="top">작성중인 메시지의 고유 ID</td></tr><tr><td valign="top">strFile</td><td valign="top">string</td><td valign="top">저장할 경로와 확장자를 포함한 파일명</td></tr></tbody></table>

```csharp
// 1. 저장할 파일 경로 설정
    // 예: C 드라이브 내 Recipe 폴더에 새 레시피 파일 저장
    string strSavePath = @"C:\EZGemPlus\Recipe\NewRecipe_v1.bin";

    // 2. GetFileBinaryItem 호출
    // lMsgId: 수신된 메시지 식별 ID
    // strFile: 저장할 대상 파일의 전체 경로
    int nSize = m_gem.GetFileBinaryItem(lMsgId, strSavePath);

    // 3. 결과 확인
    if (nSize >= 0)
    {
        Console.WriteLine($"파일 저장 성공! 저장된 크기: {nSize} bytes");
        Console.WriteLine($"경로: {strSavePath}");
    }
    else
    {
        Console.WriteLine($"파일 저장 실패. 에러 코드: {nResult}");
    }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/api-reference/item-parsing/getfilebinaryitem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
