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

[Solved] How can i get all the uploaded files in controller?

0 Answers 69 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dheyvendaran
Top achievements
Rank 1
Dheyvendaran asked on 08 Aug 2012, 06:52 AM
Hi..,

      I am using Telerik MVC3 Upload control for uploading items. i need to get all the current selection file names in a controller when create button clicked. How can i get the list of selected files in controller action method. i added the snapshot of my upload control.

Here is my controller where i need to get the filenames:

public ActionResult createfromfile(string[] filenames)
        {
            string filepath = Server.MapPath("\\App_Data\\Upload\\ (  <--->  )");      ==> i need to pass the file name here.
            string content = string.Empty;
            var stream = new StreamReader(filepath);
            try
            {
                    content = stream.ReadToEnd();
            }
            catch (Exception exc)
            {
                return Content("Uh oh!");
            }

Tags
Upload
Asked by
Dheyvendaran
Top achievements
Rank 1
Share this question
or