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

Notifications

Announcements

No record found.

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
    25,225 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,708 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
    95,599 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans