Allow only .xlsx as upload

Scripts and Codes for Power Apps
Post Reply
administrator
Site Admin
Posts: 82
Joined: Mon Dec 03, 2018 10:35 am

Allow only .xlsx as upload

Post by administrator » Fri Nov 04, 2022 3:31 pm

In AttachmentControl --> OnAddFile add the following line:

Code: Select all

If(Not(EndsWith(First(Self.Attachments).Name, ".xlsx")) ,Notify("Only .xlsx files are allowed", NotificationType.Error); Reset(Self))
This checks if the extension is .xlsx otherwise it shows an error message and removes the attachment.
Change the extension to any you would like to use.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests