This question is locked. New answers and comments are not allowed.
I am using ASP.NET MVC package that you provide free. Now i want to you uploader on my MVC application. Actually issue is that i am showing 15 records on single page and i want to upload functionality on each record. But i failed to do this with single method. Let me explain in code also:
VIEW:
----------------------------------------------------------------------------------------------------------------------------------------------
Say these are my uploder controls on single page
----------------------------------------------------------------------------------------------------------------------------------------------
1. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
2. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
3. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
4. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
5. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
----------------------------------------------------------------------------------------------------------------------------------------------
CONTROLLER (METHOD):
----------------------------------------------------------------------------------------------------------------------------------------------
public ActionResult SaveUpload(IEnumerable<HttpPostedFileBase> myUpload)
{
try
{
string URLPath = "~/Upload";
bool IsExist = System.IO.Directory.Exists(Server.MapPath(URLPath));
if (IsExist)
{ }
else
{
System.IO.Directory.CreateDirectory(Server.MapPath(URLPath));
}
foreach (var item in myUploadTra)
{
var FileName = Path.GetFileName(item.FileName);
var destinationpath = Path.Combine(Server.MapPath(URLPath), FileName);
item.SaveAs(destinationpath);
}
return Content("");
}
catch (Exception)
{
throw;
}
}
----------------------------------------------------------------------------------------------------------------------------------------------
But i failed to do this, only 1 upload is working first one only. Is there any error in My code ???
Do i have to create as much method as much uploads i want on page ???
Please reply soon,
Thanks
VIEW:
----------------------------------------------------------------------------------------------------------------------------------------------
Say these are my uploder controls on single page
----------------------------------------------------------------------------------------------------------------------------------------------
1. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
2. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
3. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
4. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
5. @Html.Telerik().Upload().Name("myUpload").Multiple(false).Async(async => async.Save("SaveUpload", "MyControllerReports").AutoUpload(true))
----------------------------------------------------------------------------------------------------------------------------------------------
CONTROLLER (METHOD):
----------------------------------------------------------------------------------------------------------------------------------------------
public ActionResult SaveUpload(IEnumerable<HttpPostedFileBase> myUpload)
{
try
{
string URLPath = "~/Upload";
bool IsExist = System.IO.Directory.Exists(Server.MapPath(URLPath));
if (IsExist)
{ }
else
{
System.IO.Directory.CreateDirectory(Server.MapPath(URLPath));
}
foreach (var item in myUploadTra)
{
var FileName = Path.GetFileName(item.FileName);
var destinationpath = Path.Combine(Server.MapPath(URLPath), FileName);
item.SaveAs(destinationpath);
}
return Content("");
}
catch (Exception)
{
throw;
}
}
----------------------------------------------------------------------------------------------------------------------------------------------
But i failed to do this, only 1 upload is working first one only. Is there any error in My code ???
Do i have to create as much method as much uploads i want on page ???
Please reply soon,
Thanks