Returns a new or existing Upload object.
Namespace:
EasyAlgo.EAUploadAssembly: EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.1.0
Syntax
| C# |
|---|
public static Upload GetUpload( string UploadId ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function GetUpload ( _ UploadId As String _ ) As Upload |
Parameters
- UploadId
- Type: System..::.String
The unique identifier of the Upload object to be returned from the uploads collection.
Return Value
An Upload object. The method returns nullNothingnullptra null reference (Nothing in Visual Basic) if Upload object with specified UploadId does not exists.
Remarks
You can use this method to create a new instance of Upload class, or to retrieve an existing instance.
Some of possible cases:
Some of possible cases:
- If you call this method on the first page load (for instance in the Page_Load handler) then new instance of Upload class are returned. You can use this instance for presetting an upload environment. You should also include the UploadID property value of this instance to query string for all requests which should be operate with this Upload object.
- If you first call this method on the page post back (for instance in the Page_Load handler inside if(IsPostBack){} statement) and you had included an unique identifier to query string then method will return an existing Upload object. This object had been created automatically by EAUploadModule. Value of UploadIDParameter had been assigned as an UploadID.
Examples
The following code example retrieves an existing Upload object from the uploads collection and gets an instance of UploadStatus class.
CopyC#
CopyVB.NET
string UploadId = Request.QueryString["UploadId"]; Upload _upload = UploadsManager.GetUpload(UploadId); UploadStatus _Status = _upload.Status; // do something useful
Dim UploadId As String = Request.QueryString("UploadId") Dim _upload As Upload = UploadsManager.GetUpload(UploadId) Dim _Status As UploadStatus = _upload.Status ' do something useful
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown when the specified UploadId parameter is nullNothingnullptra null reference (Nothing in Visual Basic). |
| EasyAlgo.EAUpload..::.EAUploadException | Thrown when Upload instance with specified UploadId parameter alredy exist and has been processed by another request. |
