Click or drag to resize

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
)

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: String
The fully qualified physical path + filename for the saved file, if successful, else null.
Remarks
If an accept value is supplied the IsFileValidateAcceptType(HttpPostedFile, String) method is used to validate that the posted file is an acceptable type. See http://www.w3schools.com/jsref/prop_fileupload_accept.asp for information on accept.
See Also