AjaxFileUpload is an ASP.NET Ajax control which supports:
Displaying File Upload Progress
Uploading Very Large Files (greater than 1 Gigabyte)
Uploading Multiple Files at a Time
Drag-and-Drop File Upload
The AjaxFileUpload control uses one of two methods of showing file upload progress. If you are using a browser which
fully supports the HTML5 File API (such as Google Chrome or Mozilla Firefox) then upload progress is displayed
using client-side events. If, on the other hand, you are using a browser which does not fully support the HTML5 standard (such as Microsoft
Internet Explorer or Apple Safari) then file upload progress is displayed by polling the server.
The AjaxFileUpload control also supports a drag-and-drop interface. You can add
multiple files to the AjaxFileUpload upload queue by dragging the files onto the
AjaxFileUpload control on a page. Alternatively, you can select multiple files to
upload by using the SHIFT key or CTRL key when selecting files with the file upload
dialog. These features are not supported by older browsers.
By taking advantage of the AllowedFileTypes property, you can restrict the types
of files which can be uploaded with the AjaxFileUpload control. For example, you
can prevent any file except image files (files with the extensions jpeg, png, or
gif) from being uploaded. By taking advantage of the MaximumNumberOfFiles property,
you can limit the number of files which can be uploaded with the control. For example,
you can prevent a user from uploading more than 5 files.
When a file is uploaded, the control's UploadComplete event is raised. By creating
an UploadComplete event handler, you can store the uploaded file anywhere that you
please including the file system, a database, or session state. Before you can save
the file to the file system, your ASP.NET application must have the necessary Write
The AjaxFileUpload control buffers the file being uploaded onto your web server's hard drive. This temporary
folder is located at Path.GetTempPath().
When you call the SaveAs() method to save the uploaded file to a new location, the AjaxFileUpload control
deletes the temporary file automatically. If you don't call the SaveAs() method (for example, you are saving the
uploaded file to a database) then you need to call the AjaxFileUploadEventArgs.DeleteTemporaryData() method
to delete the temporary file.
The AjaxFileUpload control uses an HTTP Handler named AjaxFileUploadHandler.axd
This handler has the type AjaxControlToolkit.AjaxFileUploadHandler.
You must add this handler to your Web.Config file in order for the AjaxFileUpload control to work.
<add verb="*" path="AjaxFileUploadHandler.axd"
<validation validateIntegratedModeConfiguration="false" />
<add name="AjaxFileUploadHandler" verb="*"
If you have a Windows Azure account, you may want to upload files directly to your Windows Azure storage. To do that, you need to follow these simple steps:
value="[Your Azure Connection String]"/>
This feature enables you to store uploaded files directly to Windows Azure. When uploading files directly to Windows Azure, you no longer need to create a temporary file to buffer the upload. Windows Azure has its own mechanism for buffering.
The control above is initialized with this code. The italic properties