1. Setting temporary file location

Unlike standard ASP.NET HtmlInputFile control, AJAX Uploader does not read the entire uploaded file into memory. It streams the data into a temporary file while the data is received. For this reason, you must specify a temporary file location. You should ensure that the ASPNET user (NetworkService in Windows Server 2003) has read/write permission to this specified folder.

You can easily specify the temporary file location using the following two methods:


  1. Using TempDirectory property


    For example:


    <CuteWebUI:Uploader id="Uploader1" TempDirectory="~/UploaderTemp" runat="server"></CuteWebUI:Uploader>
  2. Setting temporary file location in web.config


    Add an entry into the <appSettings> section of your application web.config file:


    <add key="CuteWebUI.AjaxUploader.TempDirectory" value="~/UploaderTemp"/>

    In web farm environments, the Url that you specify must map to a central location, which is saved to by all servers in the farm. This can be done using a virtual directory that maps to a common shared folder on the network.


    <add key="CuteWebUI.AjaxUploader.TempDirectory" value="\\shareserver\temp"/>

2. Setting MaxSizeKB

For security purpose, you should specify the limit for the size of uploaded file through MaxDataSize, in kilobytes. This limit can be used to prevent denial of service attacks that are caused, for example, by users uploading large files to the server. The default is no limit.


You can easily specify the maximum allowed size of the file using the following two methods:


  1. Using UploaderValidateOption.MaxSizeKB property


    <CuteWebUI:Uploader runat="server" ID="Uploader1">
        <ValidateOption MaxSizeKB="1000" />
    </CuteWebUI:Uploader>
    
  2. Setting GlobalMaxSizeKB in web.config


    Add an entry into the <appSettings> section of your application web.config file:


    <add key="CuteWebUI.AjaxUploader.GlobalMaxSizeKB" value="1000"/>


Send feedback about this topic to CuteSoft. © 2003 - 2017 CuteSoft Components Inc. All rights reserved.