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

User should only be allowed to upload PNG files to picture field

(1) ShareShare
ReportReport
Posted on by 30

Hello guys,

how can I force the user to only upload images in the BLOB field if it is a PNG file?

Do you have an idea how I can achieve this?

Thank you.

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    I guess the easiest way will be do a check on the filename that the user is trying to upload.

    But the actual code will depend on what table / page you are working on.

  • Maddin Profile Picture
    30 on at

    Ok, the table is 156 and the page 76. Where should I test this?

  • Suggested answer
    YUN ZHU Profile Picture
    98,421 Super User 2026 Season 1 on at

    Hi, I think what Inge means is that when you upload a file, judge whether it is a PNG from the File Name, and if it is not, an error will be prompted.
    Of course this requires customization, not a standard feature.

    For example,

    pastedimage1681875880601v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Maddin Profile Picture
    30 on at

    Hello,

    thank you very much for your help.

    Meanwhile I have created some code, that ensures that the user can only upload images of type PNG. But the problem here is that I use the data type Blob as field and if you click on the field in the page to upload an image, the default logic comes here. As soon as one apparently deposits a field of the type Blob and of the subtype Bitmap, standard functions are always run through. Only after I have then uploaded an image via the standard, next comes my window with the upload only for PNG images. Can I switch off the standard logic somehow? My logic is always later...my code is passed through, in the OnValidate trigger of the new field "Image".

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,857 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans