Click or drag to resize

FileGetFileContent Method

Upload a file from HTTP post

Namespace:  Velo.Web.Helper
Assembly:  Velo.Web (in Velo.Web.dll) Version: 22.2.10.1 (22.2.10.450)
Syntax
public static IFile GetFileContent(
	IFile pFile,
	HttpPostedFileBase pHTTPFile
)

Parameters

pFile
Type: Velo.Data.InterfaceIFile
Class/Model has field of Interface IFile
pHTTPFile
Type: System.WebHttpPostedFileBase
HTTP file object from a HTTP request

Return Value

Type: IFile
Filled field Name, Type and Content
Exceptions
ExceptionCondition
Exception Triggers an exception and throw return this.
Examples
This example upload file from HTTP request object.
// get file content
if (this.Request.Files.Count > 0)
    {
        System.Web.HttpPostedFileBase lHTTPFile = this.Request.Files[0];
        lFileContent = (Velo.Data.Models.FileContent)Velo.Web.Helper.File.GetFileContent(pFile: lFileContent, pHTTPFile: lHTTPFile);
    }
See Also