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

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,111 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
    95,712 Super User 2025 Season 2 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

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,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans