This is a migrated thread and some comments may be shown as answers.

upload multiple files to database

1 Answer 144 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 21 Jun 2013, 12:45 PM
Hi,

          I want to upload multiple  files using asyncupload rad control to database.Please give me a solution to get multiple file name of  uploaded files to store in database & store files in project folder.

Thanks,
Arun.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2013, 10:01 AM
Hi Arun,

Please have a look at this thread which deals with uploading multiple files. To store the uploaded files in the project folder, set the desired folder name in your Project directory to the RadAsyncUpload's TargetFolder property.The RadAsyncUpload1_FileUploaded method is repeatedly called until all the valid files are uploaded on the target. Using e.File.FileName you can get the file name and you can write your own logic to feed the data in the database. Another option I have tried is you can use a RadListBox to store all the uploaded file names so that you can use it a later point such as saving in database.

C#:
protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
{
    string targetfolder = RadAsyncUpload1.TargetFolder;
    e.File.SaveAs(Path.Combine(Server.MapPath(targetfolder), e.File.FileName));
    RadListBoxItem item = new RadListBoxItem(e.File.FileName); //create a RadListBoxItem and store the FileName in it.
    RadListBox1.Items.Add(item);
}

Thanks,
Shinu.
Tags
AsyncUpload
Asked by
Arun
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or