How to show file name as a hyperlink to open it

Mohammad Qasim 576 Reputation points
2020-12-22T18:34:10.557+00:00

Greetings,

Using SharePoint online

I have a custom list where user can upload/add multiple attachment .

Solution Required:
How can I show all file names ( wheatear user upload single or multiple upload ) as a hyperlink to open it with list existing columns.

50504-filenamehyperlink.pngBelow is snap for reference

Microsoft 365 and Office | SharePoint Server | Development
{count} votes

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,341 Reputation points
    2020-12-23T03:28:56.96+00:00

    Hello @Mohammad Qasim ,

    You can use the below Jquery script to achieve your design:

    Please the following steps:

    1 Copy the Jquery script and store the .js file in the Site Assets Library

    2 Go to SharePoint List, click on Edit page

    3 Add a web part named "Content Editor" under the Media and Content section
    50570-2.png

    4 Edit Web Part >> go to the Content Editor panel, copy the address link of the .js file to the Content Link textbox.
    50628-3.png

    5 Stop Editing to save page
    50642-4.png

    Thanks,
    Echo Du

    ========================
    Updated Answer =======================

    Hi @Mohammad Qasim ,

    This is because the Custom Script function is not enabled in your environment.

    There are two ways to enable the Custom Script function:

    • Step1: Using SharePoint admin center (It takes 24 hours to take effect)

    1.1 Sign in Classic SharePoint admin center as a global or SharePoint admin.
    1.2 Click on settings tab on the left navigation bar.
    50917-a1.png

    1.3 Scroll page to Custom Script section, as shown below:
    50918-a2.png

    • Step2: Using PowerShell command (Effective immediately)

    1) Run SharePoint Online Management Shell as a global or SharePoint admin.
    2) Execute the following command:

    Connect-SPOService -Url https://xxxx-admin.sharepoint.com  
    Set-SPOSite -Identity https://xxxx.sharepoint.com/sites/projects -DenyAddAndCustomizePages 0  
    

    Thanks,
    Echo Du

    ========================================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.