cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mschechter1
New Member

Disable Attachment Download on View-Only Form

Hi, 

 

We're working on a form & we would like to make attachment names read-only & not download-able. The user can only see a read-only form (backed by a SharePoint List) but when they click, they can download the attachment. Can this feature be disabled? 

 

I guess if it cannot be disabled on the DataCard item, I suppose the work around could be logic to read the names of the attachments & not use an attachment data card.... 

 

Thanks

M

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @mschechter1 ,

A bit of a workaround, but this works:-

  1. Add a Custom Card to the form
  2. Add a List Box into the card
  3. Set the Items of the List Box to ThisItem.Attachments
  4. Set the DisplayMode of the List Box to DisplayMode.View

It will display only the names of the attachments.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @mschechter1 ,

A bit of a workaround, but this works:-

  1. Add a Custom Card to the form
  2. Add a List Box into the card
  3. Set the Items of the List Box to ThisItem.Attachments
  4. Set the DisplayMode of the List Box to DisplayMode.View

It will display only the names of the attachments.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @mschechter1 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

hello @WarrenBelz 

 

i am trying to do what you mention but i cannot figure out what you mean by 

  1. Add a Custom Card to the form - i have a screen at canvas and then i have an edit form
  2. Add a List Box into the card - where is that exactly
  3. Set the Items of the List Box to ThisItem.Attachments
  4. Set the DisplayMode of the List Box to DisplayMode.View

 

@kouliscon ,

Custom Card is added to your Form

Hi @WarrenBelz Could I ask a question about powerapps?

Could you please kindly tell  if there is any way to block attachment downloads for the Powerapps app which data input is from sharepoint list.

I have tried the following steps to set the attchments open by brower.

1. Select the Attachments data card, and unlock it.

2. Add a blank vertical gallery, cut and paste it into the Attachments data card.

3. Set the "Items" property of the gallery to "ThisItem.Attachments"

4. Click the edit icon of the gallery, then add "HTML Text".

5. Select the "HTML Text", and enter the following html in "HtmlText" property:
"<a href='" & ThisItem.AbsoluteUri & "?web=1' target='_blank'>" & ThisItem.DisplayName & "</a>"

But I still want to set it view only and the download option is not available.

TiffanyJo_0-1673843845062.png

 

 

HI @Tiffany-Jo ,

Where is that menu bar screenshot from (SharePoint ?). In PowerApps you can follow my original post - bear in mind that if you allow someone to open a file, they can then simply save it from the opened file.

Hi @WarrenBelz Thank you for your reply.

When share the file in the document library, we can set it Can View and Block download.

For the attachment files of a share point list, it is difficult to get the URL of the file that Can View and Block download. Is my understanding correct?

@Tiffany-Jo ,

Yes - as I mentioned, if you are going to allow the user to open the file via URL, then what happens after is completely outside the control of Power Apps and the user can simply save the opened file with whatever app opens it on their device.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,919)