EAPUtilSavePostedFile Method (IAppContext, HttpPostedFile, String, String, Boolean, Int32, String) |
Save the provided posted file as specified. This method is used in response to the
user posting a HtmlInputFile control.
Note that this method validates maxSizeKB and accept and will throw an error if validation fails.
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static string SavePostedFile(
IAppContext appCxt,
HttpPostedFile postedFile,
string destFileName,
string destPath,
bool physicalPath,
int maxSizeKB,
string accept
)
Public Shared Function SavePostedFile (
appCxt As IAppContext,
postedFile As HttpPostedFile,
destFileName As String,
destPath As String,
physicalPath As Boolean,
maxSizeKB As Integer,
accept As String
) As String
Parameters
- appCxt
- Type: NetQuarryIAppContext
The application object. - postedFile
- Type: System.WebHttpPostedFile
The posted file stream to be saved. - destFileName
- Type: SystemString
The name under which to save the file. - destPath
- Type: SystemString
The path to which to save the file. - physicalPath
- Type: SystemBoolean
Is the specified path a physical path (vs. a virtual path)? - maxSizeKB
- Type: SystemInt32
The maximum allowed size of the file, in KB. - accept
- Type: SystemString
The acceptable file types, comma separated if multiple. If blank/null all types are considered acceptable.
Return Value
Type:
StringThe fully qualified physical path + filename for the saved file, if successful, else null.
Remarks See Also