The Inserting Image Uploader ASP.NET Control into ASP.NET Page article familiarizes you with Image Uploader ASP.NET control. Now you know how to add the control to a page and can create a simple web application which prepares a downsized copy of the user-specified image client-side, sends it along with this image, and saves both of them on a server. In the present topic we will discuss more specific tasks of Image Uploader ASP.NET control usage which were not mentioned in the previous article.
According to Aurigma licensing policy Image Uploader
requires license keys. There are two license key types: trial and full. A trial license key, as it is discussed in the
How to Evaluate Image Uploader topic, allows evaluating
Image Uploader on any domain (not only on localhost
).
Full license key removes limitations of the evaluation version and allows using the control on a domain name or IP address
Image Uploader is purchased for. Find the detailed information about full license keys
and licensing options in the Removing Limitations of Evaluation Version topic.
To add a license key to the list of Image Uploader parameters just type it in the LicenseKey property value box. These changes will be reflected in a source code as follows:
<cc1:ImageUploader ID="ImageUploader1" runat="server" height="400" width="600" LicenseKey="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX;YYYYY-YYYYY-YYYYY-YYYYY-YYYYY"> </cc1:ImageUploader>
If you have several keys, they should be separated with semicolons.
Image Uploader includes two versions, namely ActiveX control and Java applet. By default,
both these versions are enabled and used in accordance with a browser type. However, if you purchased a license for one version only,
you should disable another one. To perform this set the ActiveXControlEnabled
or JavaAppletEnabled properties of Image Uploader ASP.NET control
correspondingly to false
.
<cc1:ImageUploader ID="ImageUploader1" runat="server" height="400" width="600" ActiveXControlEnabled="True" JavaAppletEnabled="False"> </cc1:ImageUploader>
Image Uploader ASP.NET control allows displaying special instructions helping users to download and install Image Uploader. This feature is called installation progress. The detailed information on this feature is provided in the Using Image Uploader Installation Progress topic. Here we will briefly consider how to enable and customize this functionality in Image Uploader ASP.NET control.
Image Uploader ASP.NET control provides the InstallationProgress class which includes a number of properties intended to configure downloading and installation instructions and information. For example, the Visible property specifies whether to display this information while the ActiveX control or Java applet is being downloaded and installed. CommonHtml in its order contains HTML-marked description of Image Uploader displayed on the page instead of the ActiveX control before it is completely installed and initialized. The other properties correspond to the ones described in the Using Image Uploader Installation Progress topic. The following code sample illustrates how to configure installation progress in the ASP.NET control.
<head runat="server"> <title>My Web Site</title> </head> <body> <form id="form1" runat="server"> <cc1:ImageUploader ID="ImageUploader1" runat="server" height="400" width="600"> <InstallationProgress Visible="True" CommonHtml="<p>Aurigma Image Uploader ActiveX control is necessary to upload your files quickly and easily. You will be able to select multiple images in user-friendly interface instead of clumsy input fields with <strong>Browse</strong> button.</p>" ProgressHtml="<p><img src="{0}" /><br />Loading Aurigma Image Uploader ActiveX...</p>" JavaProgressHtml="<p><img src="{0}\" /><br />Loading Aurigma Image Uploader Java Applet...</p>" ProgressImageUrl="mywaitIndicator.gif" CommonInstallJavaHtml="<p>You need to install Java for running Image Uploader.</p>" IE7InstructionsHtml="<p>To install Image Uploader, please click on the <strong>Information Bar</strong> and select <strong>Install ActiveX Control</strong> or <strong>Run ActiveX Control</strong> from the dropdown menu.</p><p>Then either click <strong>Run</strong> or after page reload click <strong>Install</strong> when you see the control installation dialog. If you don't see Information Bar, please try to reload the page and/or check your security settings.</p>" IE7InstallJavaHtml="<p>To install Java, please click on the <strong>Information Bar</strong> and select <strong>Install ActiveX Control</strong> or<strong>Run ActiveX Control</strong> from the dropdown menu.</p><p>Then either click <strong>Run</strong> or after the page reload click <strong>Install</strong> when you see the control installation dialog. If you don't see Information Bar, please try to reload the page and/or check your security settings.</p>" /> </cc1:ImageUploader> </form> </body>
In the case when your web application uses cookies for keeping session or authentication information
Image Uploader ASP.NET control automatically passes this information to the upload request.
So you do not need to care about keeping your cookies saved when server upload script is called. However, if necessary,
you can disable automatic cookie preservation by specifying the
PreserveHttpCookies property to
false
.