The Framework Code

twigs/framework/devel/testupload.twig

File List

{% extends '@content/page.twig' %}

{% import '@util/formmacro.twig' as f %}
{% import '@util/modalmacro.twig' as m %}

{% block header %}
    <section class="col-md-12 mt-5">
        <h1>Test File Upload and Download</h1>
    </section>
{% endblock header %}

{% block main %}
    <section class="row">
        <article class="ml-auto col-md-10 mr-auto mb-5">
            {% include '@util/message.twig' %}
            {{f.startform({method: 'post', multi: TRUE})}}
                {{f.file({id: 'f0', name: 'upload', label: 'File'})}}
                {{f.checkbox({labels: ['Public'], values: [1], names: ['public']})}}
                <div class="mt-4">
                    {{f.submit({value: 'Upload'})}}
                </div>
            {{f.endform()}}
        </article>
    </section>
    {% if download is defined %}
        <section class="row">
            <article class="ml-auto col-md-10 mr-auto mb-5">
                <p class="class="text-center mt-4">
                    <a class="btn btn-primary" href="{{base}}/devel/upload/get/{{download}}">Download</a>
                </p>
                <p class="class="text-center">
                    <a class="btn btn-primary" href="{{base}}/devel/upload/delete/{{download}}">Delete</a>
                </p>
            </article>
        </section>
    {% endif %}
{% endblock main %}

{% block pagefooter %}
{% endblock pagefooter %}