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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / blocked mime types can...
Power Pages
Suggested Answer

blocked mime types can still be uploaded

(0) ShareShare
ReportReport
Posted on by 2
I am restricting file upload in the portal. i have already added these to the accept MIME Types field: 
 
image/bmp;text/csv;application/msword;image/gif;image/jpeg;audio/mpeg;video/mp4;video/mpeg;image/png;application/pdf;application/vnd.ms-powerpoint;text/plain;image/webp;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.openxmlformats-officedocument.wordprocessingml.document;image/heic;image/webp 
 
 
 
as well as setting the Allowed mime types in the admin center. 

 
i am still able to upload .ics, exe files masked as .mp4 file extensions. 
 
 
Additionally we have added a custom javascript to restrict file uploads
$('#AttachFile').attr('multiple', false);
$('#AttachFile').attr('accept', '.mp4,.pdf,.jpg,.png,.heic,.webp');

 

$('#AttachFile').on('change', function () {
var filePath = $(this).val();
var allowedExtensions = /(\.mp4|\.pdf|\.jpg|\.png|\.heic|\.wedp)$/i;

 

if (!allowedExtensions.exec(filePath)) {
alert('Invalid file type');
$(this).val('');
return false;
Categories:
I have the same question (0)
  • Suggested answer
    oliver.rodrigues Profile Picture
    9,449 Most Valuable Professional on at
    Since you are attaching to notes, I would recommend adding server-side plug-in to the attachments that will validate the "Magic Bytes" using c#. 
     
    This will ensure the file is as expected. 
  • pagets Profile Picture
    2 on at
    @oliver.rodrigues, can you elaborate more on that server-side validation? 
  • Suggested answer
    ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at
     
    I am adding the official URL to create and register a plugin 
     
     
    Use ChatGPT or Claude Sonnet  model to quickly generate a plugin with your logic to block the MIME type and register the plugin 
     
    Hope it helps.
    ------------
    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
     

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 51

#2
rezarizvii Profile Picture

rezarizvii 35

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 26 Most Valuable Professional

Last 30 days Overall leaderboard