Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Prevent download of attachment

Kim Kronborg
Kilo Expert

I have a form with a "Manage Attachments" link and a "[view]" link to a document attached. The view link opens in a new window so the user can see the document which is fine. But the "Manage Attachments" link downloads the attached document to the users pc and I want to prevent that.

How can I disable this ?

Is it possible to remove the "Manage Attachments" link and just leave the "view" link on the form ?

Thanks

/Kim

9 REPLIES 9

Thanks for replying but it seems like my requirement is a bit special and not easy to solve


Hi Kim,



That's would be my assessment as well.


keerthilatha
Tera Expert

Hi Kim



Did you got the solution for this


I have the same requirement if you would have solved this kindly share me the solution.



Thank you


Parul Maheshwar
Tera Contributor

Hi All,

I had the same requirement ,for certain roles I need to restrict them to download attachment ,

 

Please let me know if anyone has some leads on it .

Hi Go to the Attachment ui page and there is a client script in Attachement UI Page . So you can get the role and set the condition :

below is the function you have to give the condition in this code : 

function downloadAllAttachments(){
var downloadUrl = window.location.protocol + '//' + window.location.host + '/download_all_attachments.do?sysparm_sys_id=' + attachmentParentSysId
+ "&sysparm_this_url=" + getCurrentPageURL();
window.location = downloadUrl;
}