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)
Syntaxpublic static IFile GetFileContent(
IFile pFile,
HttpPostedFileBase pHTTPFile
)
Public Shared Function GetFileContent (
pFile As IFile,
pHTTPFile As HttpPostedFileBase
) As IFile
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| Exception | Condition |
|---|
| Exception |
Triggers an exception and throw return this.
|
Examples
This example upload file from HTTP request object.
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