web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Business Central API, convert base64 string to blob and save

(1) ShareShare
ReportReport
Posted on by 8
I created new table with blob field and API page for this table. Now I want to intercept POST request and convert base64 string to blob and save the record. Is there anyway to accomplish this? Or any better method for saving file in business central, custom made table from API request
I have the same question (0)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    26,794 Most Valuable Professional on at
    Hi
    I hope this can help you and give you some hints. 
    BR
    GR
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at
    Hi,
     
    You can try this procedure when you are getting Base64 text from API url.
        local procedure ConverBase64Text(FileContent: text)
        var
            BaseConvert: Codeunit "Base64 Convert";
            TempBlob: Codeunit "Temp Blob";
            OutStr: OutStream;
            RecRef: RecordRef;
        begin
            if FileContent = '' then
                exit;
            RecRef.Open(Database::<TargetTable>);
            RecRef.GetTable(<TargetTable>);
            TempBlob.CreateOutStream(OutStr);
            BaseConvert.FromBase64(FileContent, OutStr);
    
            TempBlob.ToRecordRef(RecRef, <TargetTable>.FieldNo(<BlobField>));
            RecRef.SetTable(<TargetTable>);
            RecRef.Close();
        end;
     
  • Suggested answer
    YUN ZHU Profile Picture
    101,115 Super User 2026 Season 1 on at
    Hi, here is a good example, I hope it can give you some help.
     
    Thanks.
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,138 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,279 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,192

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans