i have also tried with this code that found some where in this forum,also its not working:
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
CuteWebUI;
public
partial class Upload : System.Web.UI.Page
{
Button b2 = new Button();
Uploader _uploader;
protected override void OnLoad(EventArgs e)
{
_uploader =
new Uploader();
_uploader.ID =
"MyUploader";
_uploader.InsertText =
"Select file";
_uploader.ValidateOption.AllowedFileExtensions =
".mp3,.MP3,.wav,.WAV";
_uploader.TempDirectory =
"Uploads";
_uploader.FileUploaded +=
new UploaderEventHandler(_uploader_FileUploaded);
Page.Form.Controls.Add(_uploader);
base.OnLoad(e);
}
void _uploader_FileUploaded(object sender, UploaderEventArgs args)
{
string path = Server.MapPath("Uploads");
//args.CopyTo(path + "\\" + args.FileName);
args.MoveTo(path +
"\\" + args.FileName);
}
}