Registered file upload, anonymous file download


Newbie here, but I managed to install everything on my raspberry pi to get Grav up and running.

What I’d like to do is learn how to build a website similar in functionality to and create a place for users to register, upload their code (.mrc or collection of files in .zip format) so that those files are displayed publicly.

So far I managed to make a file upload section in Grav:

title: Upload
    markdown: true
    twig: true
        login: true
    name: upload
            name: description
            label: Description
            type: text
                required: true
            type: select
            size: medium
            label: Type
                script: 'Script (.zip)'
                addon: 'Addon (.mrc or .ini)'
                dll: 'DLL (.zip)'
                mts: 'Theme (.zip)'
            name: myfile
            label: 'My File'
            type: file
            destination: user/data/upload
            multiple: false
            random_name: true
            avoid_overwriting: true
                - .zip
                - .mrc
                - .ini
            type: submit
            value: Submit
                from: '{{ }}'
                to: ['{{ }}', '{{ }}']
                subject: '[Feedback] {{|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
                fileprefix: feedback-
                dateformat: dmY-His-u
                extension: txt
                body: '{% include ''forms/data.txt.twig'' %}'
            message: 'Thank you for your feedback!'
            display: thankyou

For now I’m looking for a way for Grav to display in /home all uploaded files with a bit of extra data. For example:

Upload date Description Type Size Username Download
13-01-2018 Peace and Protection 4.22.7 .zip 1151497 admin click here to download

I should be able to retrieve all this data from the feedback-.txt files. How do I read the feedback-.txt files and build a simple table so that anonymous users can download the files from the /home page?

kind regards!

I’m now looking at the following:

Also, I’ve installed the comments plugin and started looking at how it works. I suppose I will try to answer my own question in this thread!

It seems flex-directory plugin is what I desire. I shall follow the instructions as found here:

Then, I have to figure out what the mechanism is for front-end to CRUD the data in the entries.json file…