0

I have been asked if we can create a custom download link on a SharePoint Modern library, replacing the existing one, which saves the file with a name made from file metadata.

I am assuming that this can be done via SPFX extensions but have only just begun using SPFX.

Presumably the task is to:

  1. Hide the exiting links (toolbar and edit menu).
  2. Create the new functionality.

Can anyone comment on if/how this might work?

1 Answer 1

0

You could build the ListView command by SPFX and use the custom code to hide the existing download link in the modern document library.

More references:

Build your first ListView Command Set extension.

Use an SPFx Application Customizer to add JavaScript (e.g. header) to every page in a site

SPFx Applications Customiser CSS Injection

4
  • Thanks Amy I've managed to create the HelloWord extension. Is it possible to override the exisitng data-automationid="downloadCommand" or do I need to replace the existing items?
    – Bill Young
    Commented Sep 4, 2019 at 7:34
  • I am afraid it is not possible to override the existing download command. you could create a new download command.
    – Amy_MSFT
    Commented Sep 4, 2019 at 8:14
  • Thanks again for the feedback Those references are great. What the best way to create the new functionality?
    – Bill Young
    Commented Sep 5, 2019 at 6:58
  • You could use SPFx solution to create the listview command and develop the custom code for the download function.
    – Amy_MSFT
    Commented Sep 5, 2019 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.