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

Notifications

Announcements

Community site session details

Community site session details

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard