This question is locked. New answers and comments are not allowed.
My console outputs that it cant find my save class in my LocalBusiness controller. Here's the code:
In my View
@(Html.Telerik().Upload()
.Name("attachments")
.Async(async => async
.Save("Save", "LocalBusinessController")
.Remove("Remove", "LocalBusinessController")
))
In my Controller:
public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments)
{
// The Name of the Upload component is "attachments"
foreach (var file in attachments)
{
// Some browsers send file names with full path. We only care about the file name.
var fileName = Path.GetFileName(file.FileName);
var destinationPath = Path.Combine(Server.MapPath("~/Comtent/images"), fileName);
file.SaveAs(destinationPath);
}
// Return an empty string to signify success
return Content("");
}
//removing and image
public ActionResult Remove(string[] fileNames)
{
foreach (var fullName in fileNames)
{
var fileName = Path.GetFileName(fullName);
var physicalPath = Path.Combine(Server.MapPath("../../Content/images"), fileName);
// TODO: Verify user permissions
if (System.IO.File.Exists(physicalPath))
{
System.IO.File.Delete(physicalPath);
}
}
// Return an empty string to signify success
return Content("");
}
In my _Layout.cshtml
@(Html.Telerik().ScriptRegistrar())
Thankss in advance for any help!!
In my View
@(Html.Telerik().Upload()
.Name("attachments")
.Async(async => async
.Save("Save", "LocalBusinessController")
.Remove("Remove", "LocalBusinessController")
))
In my Controller:
public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments)
{
// The Name of the Upload component is "attachments"
foreach (var file in attachments)
{
// Some browsers send file names with full path. We only care about the file name.
var fileName = Path.GetFileName(file.FileName);
var destinationPath = Path.Combine(Server.MapPath("~/Comtent/images"), fileName);
file.SaveAs(destinationPath);
}
// Return an empty string to signify success
return Content("");
}
//removing and image
public ActionResult Remove(string[] fileNames)
{
foreach (var fullName in fileNames)
{
var fileName = Path.GetFileName(fullName);
var physicalPath = Path.Combine(Server.MapPath("../../Content/images"), fileName);
// TODO: Verify user permissions
if (System.IO.File.Exists(physicalPath))
{
System.IO.File.Delete(physicalPath);
}
}
// Return an empty string to signify success
return Content("");
}
In my _Layout.cshtml
@(Html.Telerik().ScriptRegistrar())
Thankss in advance for any help!!