---
id: post/yzhums-com/68656
type: post
title: "Dynamics 365 Business Central: How to copy values (Blob) ​​from one Codeunit “Temp Blob” to another Codeunit “Temp Blob”"
summary: Copying BLOB data from one Temp Blob codeunit to another requires creating an InStream from the source, an OutStream to the target, and using CopyStream to transfer the data. This technique became relevant after Microsoft deprecated Record TempBlob in BC15 and introduced the Temp Blob codeunit.
tier: community
language: en
tags:
  - temp blob
  - blob storage
  - codeunit
  - data copying
  - streams
  - file handling
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:41:46.651Z"
  flags: []
generated:
  at: "2026-11-30T10:37:49.603Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: c2fcbeb61ffcf62dc0248ac557033dc2c14f26ca91bf7780f57655481d0eb3de
evidence:
  - kind: blog
    url: https://yzhums.com/68656/
    title: "Dynamics 365 Business Central: How to copy values (Blob) ​​from one Codeunit “Temp Blob” to another Codeunit “Temp Blob”"
    date: "2025-10-29"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/68656/
    title: "Dynamics 365 Business Central: How to copy values (Blob) ​​from one Codeunit “Temp Blob” to another Codeunit “Temp Blob”"
    date: "2025-10-29"
    commit: null
    t: null
    quote: When you're writing code to manage the importing and exporting of files, you can use this codeunit.
links:
  learn: []
  objects:
    - object/codeunit/4100
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-attachments
      title: Attachment capabilities and limitations (preview)
      label: possibly related
      why: names Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/64042
      title: "Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)"
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/63595
      title: "Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs)"
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/65522
      title: "Dynamics 365 Business Central: Generate Swiss QR Code without external services/APIs"
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/68624
      title: "Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox)"
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/63942
      title: "Dynamics 365 Business Central: How to preview Word (.docx) in web client without downloading (No control add-in and APIs)"
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/demiliani-com/12623
      title: "Dynamics 365 Business Central: previewing PDF files in web client using the new ExtendedDataType = Document."
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/aardvarklabs-blog/2202
      title: Step by Step Guide to Importing Excel Data into Business Central
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-streams-overview
      title: Using streams in Business Central
      label: possibly related
      why: names Codeunit 4100 "Temp Blob"
      by: code
post_id: "68656"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/68656/
published_at: "2025-10-29T01:23:01.000Z"
author: Yun Zhu
full_text: false
words: 296
quotes:
  - text: When you're writing code to manage the importing and exporting of files, you can use this codeunit.
    why_it_matters: Defines the primary use case for Temp Blob, helping developers understand when to apply this technique
code_objects_mentioned:
  - codeunit Temp Blob
systems:
  - development
versions_mentioned:
  - BC15
  - 2019 Release Wave 2
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2021/01/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2021-01-22-114846.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-11-29T00:40:53.146Z"
---

# Dynamics 365 Business Central: How to copy values (Blob) ​​from one Codeunit “Temp Blob” to another Codeunit “Temp Blob”

[Read the post](https://yzhums.com/68656/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2025-10-29 · 296 words · tier community · reviewed (checked by Opus)

> Copying BLOB data from one Temp Blob codeunit to another requires creating an InStream from the source, an OutStream to the target, and using CopyStream to transfer the data. This technique became relevant after Microsoft deprecated Record TempBlob in BC15 and introduced the Temp Blob codeunit.

## Key points

- Temp Blob codeunit replaced deprecated Record TempBlob starting in 2019 Release Wave 2 (BC15)
- CreateInStream method reads data from the source BLOB with optional Encoding parameter
- CreateOutStream method writes data to the target BLOB with optional Encoding parameter
- Use CopyStream function to transfer data between InStream and OutStream objects

## Quotes

- "When you're writing code to manage the importing and exporting of files, you can use this codeunit." (Defines the primary use case for Temp Blob, helping developers understand when to apply this technique)

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- [codeunit 4100 "Temp Blob"](../../objects/codeunit/4100.md)

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Attachment capabilities and limitations (preview)](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-attachments) — possibly related: names Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)](../../posts/yzhums-com/64042.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs)](../../posts/yzhums-com/63595.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: Generate Swiss QR Code without external services/APIs](../../posts/yzhums-com/65522.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox)](../../posts/yzhums-com/68624.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: How to preview Word (.docx) in web client without downloading (No control add-in and APIs)](../../posts/yzhums-com/63942.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: previewing PDF files in web client using the new ExtendedDataType = Document.](../../posts/demiliani-com/12623.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Step by Step Guide to Importing Excel Data into Business Central](../../posts/aardvarklabs-blog/2202.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Using streams in Business Central](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-streams-overview) — possibly related: names Codeunit 4100 "Temp Blob"

## Context

- Features: Temp Blob codeunit, CreateInStream, CreateOutStream, CopyStream, BLOB data management, file import/export
- Versions: BC15, 2019 Release Wave 2

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
