如何利用Microsoft Flow实现SharePoint站点视频文件上传拦截?
Got it, let's walk through refining your Microsoft Flow setup to reliably block video uploads—your core approach is spot-on since SharePoint doesn't have native file-type filtering for uploads. Here's how to make it work smoothly:
Step 1: Set Up the Flow Trigger
- Start with the When a file is created (properties only) trigger, and select your target SharePoint document library. This ensures the flow fires the moment a new file is added.
Step 2: Add the Content Type Check Condition
- Insert a Condition action right after the trigger. This is where we'll flag video files:
- On the left side, select the File Content Type dynamic content pulled from the trigger.
- Choose the starts with operator.
- On the right side, paste this expression:
@startsWith(triggerBody()?['FileContentType'], 'video/')
This catches all standard video formats (MP4, MOV, AVI, etc.) since their MIME types all start with
video/.
Step 3: Configure the Block Action
- In the If yes branch of the condition (where the file is a video):
- Add the Delete file action. Select your SharePoint site and library, then use the File Identifier dynamic content from the trigger to target the uploaded video.
- Optional (but recommended): Add a Send an email (V2) action here to notify the user that their video upload was blocked, along with a quick note about the site's file policy.
Step 4: Test and Validate
- Upload a test video to confirm the flow triggers, detects the video content type, and deletes the file automatically.
- Upload a non-video file (like a PDF or Word doc) to make sure legitimate files aren't affected.
Quick Pro Tips
- Permissions Double-Check: Since you're the site owner, your flow should have full access to delete files, but if you run into errors, verify the flow's connection has the necessary library permissions.
- Expand to Other File Types: If you want to block audio files too, add an Or clause in the condition to check for
audio/as the MIME type prefix.
内容的提问来源于stack exchange,提问作者Avsrot
相关产品推荐
相关产品推荐

