cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JayashreeKrish
Resolver II
Resolver II

throw error for attachment in canvas app


I have this one peculiar scenario in my canvas app( which has sharepoint as its datasource). There is an attachment section. I have set the limit as 250 MB and 6 as maximum file attachment. But if I attach more than 250 MB , the form gets submitted but my cloud flow(we use flow to send data from canvas app to model driven app) fails. Attachment is present in sharepoint list , But it is not present in model driven app. My case is "I dont want to allow users to upload more than 250 MB" in canvas app. I am not able to restrict the user not to upload more than 250 MB. I am only able to restrict the maximum number of files. Pls let me know how to handle this and throw error in canvas application itself.

1 ACCEPTED SOLUTION

Accepted Solutions
EddieE
Solution Sage
Solution Sage

@JayashreeKrish 

It would seem that it's not possible to get/check file sizes until they are uploaded to SharePoint, this is because :

 

"Logically, a local file needs to be uploaded to get its file size."

 

See this forum post:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Attachment-control-file-size-minimum-validat...

 

That post has a Flow use case for deleting 0KB files sizes which you could adjust for you situation. You may need to build out a notification to users who upload >250MB of data to let them know that, for example, Files 1-3 were uploaded however Files 4-5 were not due to size restrictions.

 

Not ideal because you really want this info at the attachment stage but it seems PowerApps cannot read file size of local files. I guess though, if user only uploaded SharePoint/OneDrive file you may be able to check file size??

View solution in original post

1 REPLY 1
EddieE
Solution Sage
Solution Sage

@JayashreeKrish 

It would seem that it's not possible to get/check file sizes until they are uploaded to SharePoint, this is because :

 

"Logically, a local file needs to be uploaded to get its file size."

 

See this forum post:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Attachment-control-file-size-minimum-validat...

 

That post has a Flow use case for deleting 0KB files sizes which you could adjust for you situation. You may need to build out a notification to users who upload >250MB of data to let them know that, for example, Files 1-3 were uploaded however Files 4-5 were not due to size restrictions.

 

Not ideal because you really want this info at the attachment stage but it seems PowerApps cannot read file size of local files. I guess though, if user only uploaded SharePoint/OneDrive file you may be able to check file size??

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,540)