Ultimate Uploader v1.4
ASP.NET Control
|
|
Requirements
Integration into ASP.NET project
- Create new or open existing ASP.NET web application.
- Add reference to assembly ElementIT.UltimateUploader.
- From the context menu of a toolbox tab select Choose Items. In the appeared
window click Browse button and pick ElementIT.UltimateUploader.dll
assembly. The UltimateUploader component will be added in the Toolbox Items
list. Click OK button and make sure that on the tab UltimateUploader control
has appeared.
- Drop on page UltimateUploader control.
- Further it is necessary to create upload handler. Select your project, click -
New Item - Generic Handler. Replace generated code in the cs-file on
the following code (where MyTestApp - namespace of your project):
namespace MyTestApp
{
public class MyHandler : ElementIT.SilverlightUpload.UploadHandler
{
}
}
By default files are saved in Upload folder in the application directory.
You can change this behavior having defined the constructor of the handler class
and having assigned a required value to SavePath property, as shown below:
namespace MyTestApp
{
public class MyHandler : ElementIT.UltimateUploader.UploadHandler
{
public MyHandler()
{
SavePath = @"E:\MyUploads";
}
}
}
Create the abovementioned folder for uploaded files in the file system and grant
write permission for it to account under which ASP.NET runs (usually NETWORK SERVICE).
If you want to make additional postprocessing for each uploaded file (for
example move to a database or in other location depending on the data received
with file) add a FileUploaded event handler, like this:
namespace MyTestApp
{
public class MyHandler : ElementIT.UltimateUploader.UploadHandler
{
public MyHandler()
{
SavePath = @"E:\MyUploads";
FileUploaded += new System.EventHandler<FileUploadedEventArgs>(MyHandler_FileUploaded);
}
void MyHandler_FileUploaded(object sender, FileUploadedEventArgs e)
{
e.UploadedFile.MoveTo(e.UploadedFile.FullName + e.FileComment + e.Tag);
}
}
}
Compile and run the application.