# Issue sending facial templates to devices using SDK 2.52

**URL:** <https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462>\
**Category:** Integration\
**Tags:** facepass7pro, facedeep5, sdk\
**Created:** [November 2, 2023, 11:34am UTC](https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462 "2023-11-02T11:34:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrodrigues](https://sea2.discourse-cdn.com/flex020/user_avatar/community.anviz.com/mrodrigues/32/840_2.png) [@mrodrigues](https://community.anviz.com/u/mrodrigues)\
**Post date:** [November 2, 2023, 11:34am UTC](https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462/1 "2023-11-02T11:34:55Z")

</div>

Hi all, I need help using the SDK version 2.52.

I’m trying to send a facial template using this piece of code (adapted from the SDK to suit my necessities):

```auto
public int SendPhoto(DevClock connectedClock, AnvizPhoto photo, AnvizUser user)
{
  int ret = 0;
  if ((connectedClock.DevTypeFlag & (int)AnvizLib.MODE_FP_Type.DEV_TYPE_FLAG_FACEPASS_PICTURE) != 0)
  {
    if (photo.DataLength > 0)
    {
      AnvizLib.CCHEX_DEL_PERSON_INFO_STRU Data;

      Data.EmployeeId = new byte[5];
      Conversions.string_to_byte(user.UserID, Data.EmployeeId, 5);
      Data.operation = 11;

      byte[] photoArray = new byte[photo.DataLength];
      Array.Copy(photo.BinaryData, 0, photoArray, 0, photo.DataLength);

      ret = AnvizLib.CChex_UploadFacePictureModule(anviz_handle, connectedClock.DevIdx, ref Data, photo.BinaryData, photo.DataLength);
    }
  }
  return ret;
}

```

This code works fine, but when I get the CChex\_Update message type in return it gives me an error (Result -1).

```auto
case (int)AnvizLib.MsgType.CCHEX_RET_UPLOAD_FACE_PICTURE_MODULE_TYPE:
{
  AnvizLib.CCHEX_UPLOAD_FACE_PICTURE_MODULE result;
  result = (AnvizLib.CCHEX_UPLOAD_FACE_PICTURE_MODULE)Marshal.PtrToStructure(pBuff, typeof(AnvizLib.CCHEX_UPLOAD_FACE_PICTURE_MODULE));
  DevClock clock = GetConnectedClock(dev_idx[0]);

  if (result.Result == 0)
  {
    SWLogger.DebugFmt("Photo succesfully uploaded. Result {0} [User {1} - Device {2} ({3})]",
                      result.Result, Conversions.Employee_array_to_srring(result.EmployeeId),
                      clock.Clock.Name, clock.Clock.Ip);
  }
  else
  {
    SWLogger.DebugFmt("Photo failed to upload. Result {0} [User {1} - Device {2} ({3})]",
                      result.Result, Conversions.Employee_array_to_srring(result.EmployeeId),
                      clock.Clock.Name, clock.Clock.Ip);
  }
}
break;

```

The picture was downloaded using the CChex\_DownloadFacePictureModule SDK method, getting the result from the CChex\_Update with a message type of CCHEX\_RET\_DOWNLOAD\_FACE\_PICTURE\_MODULE\_TYPE and saved into a SQL Server instance using a VarBinary field to store the data from the picture.

Am I doing something wrong?  
I appreciate any help you can provide.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mrodrigues](https://sea2.discourse-cdn.com/flex020/user_avatar/community.anviz.com/mrodrigues/32/840_2.png) [@mrodrigues](https://community.anviz.com/u/mrodrigues)\
**Post date:** [November 2, 2023, 11:36am UTC](https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462/2 "2023-11-02T11:36:19Z")

</div>

Sorry to bother you @Felix_Anviz.  
I’m tagging you here as you already helped me before.

---

<div class="post-metadata">

**Author:** ![mrodrigues](https://sea2.discourse-cdn.com/flex020/user_avatar/community.anviz.com/mrodrigues/32/840_2.png) [@mrodrigues](https://community.anviz.com/u/mrodrigues)\
**Post date:** [November 2, 2023, 11:49am UTC](https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462/3 "2023-11-02T11:49:27Z")

</div>

Sorry to bother @shannon.xiang.  
I’m tagging you here as you are the Support contact provided to Softworks.

---

<div class="post-metadata">

**Author:** ![Leonardo\_Anviz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.anviz.com/leonardo_anviz/32/60_2.png) [@Leonardo\_Anviz](https://community.anviz.com/u/Leonardo_Anviz)\
**Post date:** [November 9, 2023, 12:49pm UTC](https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462/4 "2023-11-09T12:49:51Z")

</div>

Hi @mrodrigues

I´m sending a message to @Felix_Anviz again, he is the right person to help on integration questions…

Sorry for the delay

---

<div class="post-metadata">

**Author:** ![mrodrigues](https://sea2.discourse-cdn.com/flex020/user_avatar/community.anviz.com/mrodrigues/32/840_2.png) [@mrodrigues](https://community.anviz.com/u/mrodrigues)\
**Post date:** [November 9, 2023, 1:38pm UTC](https://community.anviz.com/t/issue-sending-facial-templates-to-devices-using-sdk-2-52/1462/5 "2023-11-09T13:38:02Z")

</div>

Thank’s @Leonardo_Anviz, really appreciate it.
