Click or drag to resize

ReportTemplateControllerFileUpload Method

Upload a file to save to database

Namespace:  Velo.Web.Controllers
Assembly:  Velo.Web (in Velo.Web.dll) Version: 22.2.10.1 (22.2.10.450)
Syntax
public ActionResult FileUpload(
	FormCollection pCollection
)

Parameters

pCollection
Type: FormCollection
Form data must exist a HTML element by ID called "ReportTemplateID"

Return Value

Type: ActionResult
Redirection to "Index" view
Examples
This example implement into a web dialog
<div class="modal fade" id="DialogReportTemplateUpload" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            @using (Html.BeginForm("FileUpload", "ReportTemplate", FormMethod.Post, new { enctype = "multipart/form-data" }))
            {
                @Html.AntiForgeryToken()
                <div class="alert alert-info hidden-print">
                    <h4>
                        Datei &nbsp;&nbsp;&nbsp;
                        <button id="DialogReportTemplateUploadButtonSave" type="submit" name="Button" value="Save" class="btn btn-primary" title="Daten speichern und Dialog schliessen"><span class="glyphicon glyphicon-ok"></span>&nbsp;&nbsp;Speichern</button>
                        <button id="DialogReportTemplateUploadButtonClose" type="button" class="btn btn-primary" onclick="DialogReportTemplateUploadClose();" title="Dialog schliessen ohne speichern"><span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;Schliessen</button>
                    </h4>
                </div>
                <div id="DialogReportTemplateUploadContent" class="modal-body">
                    <input type="hidden" id="ReportTemplateID" name="ReportTemplateID" />
                    <input type="file" id="DialogReportTemplateUploadFileBrowser" name="UploadFile" />
                </div>
            }
        </div>
    </div>
</div>
See Also