1

Ordered, filtered list of attachments and images of a metadata table

Order by -size and filter is size > 100kB - can canged. Table name must be changed. Is from my post from the German forum. Maybe someone here can use it.

do as server
    let resultObject := [{}][= null];
    for j in select TABLE do
        let meFiles := files(j);
        for i in meFiles do
            let metadata := fileMetadata(j, last(split(text(i), "/")));
            let partObject := {
                    id: number(j),
                    name: metadata.name,
                    size: metadata.size,
                    modifiedDate: metadata.modifiedDate
                };
            resultObject := array(resultObject, [partObject])
        end
    end;
    let css := "<style>td,th{padding: 0 .7em;border: thin solid black;}table{border-collapse:collapse;}</style>";
    let head := "<tr><th>id</th><th>size</th><th>name</th><th>modifiedDate</th></tr>";
    let body := for x in resultObject[size > 100000] order by -number(size) do
            ---
        <tr><td>{ x.id }</td><td>{ format(round(number(x.size) / 1000), "#,## kB0.0") }</td><td>{ x.name } </td><td>{ format(date(x.modifiedDate), "DD.MM.Y") }</td></tr>
            ---
        end;
    html(---
<table>{ css }{ head }{ body }</table>
    ---)
end

Reply

null

Content aside

  • 1 Likes
  • 5 mths agoLast active
  • 30Views
  • 1 Following