Sharepoint-Online „Download“ – Button in Bibliothek

Es gibt verschiedene Wege eine Datei aus einer Sharepoint-Online-Bibliothek herunterzuladen.

Man würde die Datei markieren und dann über das Menü gehen, oder mit der rechten Maustaste im Kontextmenü der Datei auf „Herunterladen“ klicken.

Es gibt aber keine Option direkt neben der Datei.

Diese Möglichkeit kann man via „Download“-Button mit der Spaltenformatierung erreichen.

Dazu erstellt man eine beliebige Spalte in der Bibliothek (z.B. Text). Danach muss diese Spalte mit etwas JSON-Code formatiert werden. Fertig!

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "button",
    "style": {
        "border-radius": "5px",
        "margin": "5px 0px",
        "padding": "0px",
        "visibility": "=if([$ContentType] == 'Folder', 'hidden', 'visible')"
    },
    "attributes": {
        "class": "ms-bgColor-themePrimary"
    },
    "children": [
        {
            "elmType": "a",
            "txtContent": "Upload",
            "style": {
                "text-decoration": "none",
                "padding": "10px 0px",
                "width": "100%"
            },
            "attributes": {
                "href": "= @currentWeb + '/_layouts/15/upload.aspx?UniqueId=' + [$UniqueId]",
                "target": "_blank",
                "class": "ms-fontColor-white"
            }
        }
    ]
}

Kommentare sind geschlossen