catalog item download a file from catalog item

dilini
Giga Expert

Hi,

I need an user/customer to download file into their hard drive from a cat item form when the user click download link. I know the sys_id of the file saved in sys_attached table.

Thank you!

8 REPLIES 8

Mihir Mohanta
Kilo Sage

Hi Dilini,



You can find your answer in the below thread.


Re: Attachement



Thanks,


Mihir


I used that thread and wrote a macro and include it to my form. But, problem is that when I click the link it send me to login page of the service now instance. I want download the file (excel) into my hard drive.


Give the proper instance name and sys_id of the URL you have used.Thn it will not redirect to login page.



Please go to sys_attachment.LIST and copy the sys_id of the attachment like below image.(Right click on the attachment record and select copy sys_id)



find_real_file.png




Thanks,


Mihir


dilini
Giga Expert

Hi Mihir,


I used correct sys_id of the file (this file is attached to the catalog item) and used following macro. It is still redirect to the login page of the instance (https://xxxxdev.service-now.com/)



-------------------


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<p> <b><font color="red">Please download Form and Attach Updated Form, </font> <a href="https://xxxxdev.service-now.com/sys_attachment.do?sys_id=b84b99ab6f19ae00cfd1f37cbb3ee47d" target ="_blank"><font color="blue">Click Here</font></a><font color="red"> to download form.</font> </b></p>      


</j:jelly>


-------------------